
Chapter 14 Multitasking Control Statements
14-9
PROGRAM PRO1
i1 = CREATESEM(0)
RUN PRO2
RUN PRO3
END
PROGRAM PRO2
TAKESEM i1
.
.
.
GIVESEM i1
END
PROGRAM PRO3
TAKESEM i1
.
.
.
GIVESEM i1
END
(3) Countermeasure when an infinite wait occurs.
To get out of this status, run a calling program (ipro1 in this example) after
stopping the program (pro3 in this example) that is in an infinite wait
status.
(4) Observe the following for proper use of this statement.
Do not rewrite the ID of a semaphore that is in a wait status. Especially
observe the following two points.
1) Create a semaphore that uses the same variable number only once as
long as it is not clearly deleted.
2) Do not use a variable which controls a semaphore ID for other
purposes.
Comentarios a estos manuales