home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / aijournl / 1986_09 / cli.fun < prev    next >
Text File  |  1986-06-07  |  768b  |  26 lines

  1.  
  2. The Semaphore Functions
  3.  
  4.  
  5.         WAIT
  6.           - Input:   a semaphore name
  7.             Output:  none
  8.           - if semaphore's value = 1,
  9.             then
  10.               - set value to 0
  11.               - return
  12.             else
  13.               - remove this task from ready list
  14.               - place this task in the queue waiting upon this semaphore
  15.               - switch to another task
  16.  
  17.         SIGNAL
  18.           - Input:   a semaphore name
  19.             Output:  none
  20.           - if there are processes waiting upon this semaphore,
  21.             then
  22.               - remove one from the queue and add it to the ready list
  23.               - return
  24.             else
  25.               - set the semaphore's value = 1
  26.