home *** CD-ROM | disk | FTP | other *** search
-
-
-
- ccccppppsssseeeemmmmaaaa((((DDDD3333XXXX)))) ccccppppsssseeeemmmmaaaa((((DDDD3333XXXX))))
-
-
-
- NNNNAAAAMMMMEEEE
- _cccc_pppp_ssss_eeee_mmmm_aaaa - conditionally perform a "P" or wait semaphore operation
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _""""_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_""""
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _""""_ssss_yyyy_ssss_////_ssss_eeee_mmmm_aaaa_...._hhhh_""""
-
- _iiii_nnnn_tttt _cccc_pppp_ssss_eeee_mmmm_aaaa_((((_ssss_eeee_mmmm_aaaa______tttt _****_s_e_m_a_p_))))_;;;;
-
- AAAArrrrgggguuuummmmeeeennnnttttssss
- _s_e_m_a_p
- Expects a pointer to the semaphore you want _cccc_pppp_ssss_eeee_mmmm_aaaa to conditionally
- decrement.
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _cccc_pppp_ssss_eeee_mmmm_aaaa conditionally performs a "P" operation depending on the current
- value of the semaphore. If the semaphore value is less than or equal to
- 0, _cccc_pppp_ssss_eeee_mmmm_aaaa returns without altering the semaphore. Otherwise, _cccc_pppp_ssss_eeee_mmmm_aaaa
- decrements the semaphore value by 1 and returns. _cccc_pppp_ssss_eeee_mmmm_aaaa effectively
- performs a "P" operation if it does not cause the process to sleep;
- otherwise, it simply returns. To initialize semaphores before using them,
- 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).
-
- RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss
- _cccc_pppp_ssss_eeee_mmmm_aaaa returns 0 if the semaphore value is less than or equal to 0. (If
- _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
- 1.
-
- SSSSeeeeeeee AAAAllllssssoooo
- _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)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-