home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / catD / cpsema.z / cpsema
Encoding:
Text File  |  2002-10-03  |  3.2 KB  |  67 lines

  1.  
  2.  
  3.  
  4. ccccppppsssseeeemmmmaaaa((((DDDD3333XXXX))))                                                        ccccppppsssseeeemmmmaaaa((((DDDD3333XXXX))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _cccc_pppp_ssss_eeee_mmmm_aaaa - conditionally perform a "P" or wait semaphore operation
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _""""_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_""""
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _""""_ssss_yyyy_ssss_////_ssss_eeee_mmmm_aaaa_...._hhhh_""""
  14.  
  15.      _iiii_nnnn_tttt _cccc_pppp_ssss_eeee_mmmm_aaaa_((((_ssss_eeee_mmmm_aaaa______tttt _****_s_e_m_a_p_))))_;;;;
  16.  
  17.    AAAArrrrgggguuuummmmeeeennnnttttssss
  18.      _s_e_m_a_p
  19.           Expects a pointer to the semaphore you want _cccc_pppp_ssss_eeee_mmmm_aaaa to conditionally
  20.           decrement.
  21.  
  22. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  23.      _cccc_pppp_ssss_eeee_mmmm_aaaa conditionally performs a "P" operation depending on the current
  24.      value of the semaphore. If the semaphore value is less than or equal to
  25.      0, _cccc_pppp_ssss_eeee_mmmm_aaaa returns without altering the semaphore. Otherwise, _cccc_pppp_ssss_eeee_mmmm_aaaa
  26.      decrements the semaphore value by 1 and returns. _cccc_pppp_ssss_eeee_mmmm_aaaa effectively
  27.      performs a "P" operation if it does not cause the process to sleep;
  28.      otherwise, it simply returns. To initialize semaphores before using them,
  29.      call _iiii_nnnn_iiii_tttt_nnnn_ssss_eeee_mmmm_aaaa(D3X) or _iiii_nnnn_iiii_tttt_nnnn_ssss_eeee_mmmm_aaaa______mmmm_uuuu_tttt_eeee_xxxx(D3X).
  30.  
  31.    RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss
  32.      _cccc_pppp_ssss_eeee_mmmm_aaaa returns 0 if the semaphore value is less than or equal to 0. (If
  33.      _cccc_pppp_ssss_eeee_mmmm_aaaa returns 0, _pppp_ssss_eeee_mmmm_aaaa(D3X) would have slept.) Otherwise _cccc_pppp_ssss_eeee_mmmm_aaaa returns
  34.      1.
  35.  
  36.    SSSSeeeeeeee AAAAllllssssoooo
  37.      _iiii_nnnn_iiii_tttt_nnnn_ssss_eeee_mmmm_aaaa(D3X), _iiii_nnnn_iiii_tttt_nnnn_ssss_eeee_mmmm_aaaa______mmmm_uuuu_tttt_eeee_xxxx(D3X), _pppp_ssss_eeee_mmmm_aaaa(D3X), _SSSS_LLLL_EEEE_EEEE_PPPP______TTTT_RRRR_YYYY_LLLL_OOOO_CCCC_KKKK(D3)
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.