home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
aijournl
/
1986_09
/
cli.fun
< prev
next >
Wrap
Text File
|
1986-06-07
|
768b
|
26 lines
The Semaphore Functions
WAIT
- Input: a semaphore name
Output: none
- if semaphore's value = 1,
then
- set value to 0
- return
else
- remove this task from ready list
- place this task in the queue waiting upon this semaphore
- switch to another task
SIGNAL
- Input: a semaphore name
Output: none
- if there are processes waiting upon this semaphore,
then
- remove one from the queue and add it to the ready list
- return
else
- set the semaphore's value = 1