Bug 1885489 - Part 9: Add SnapshotIterator::readObject(). r=iain
[gecko.git] / docs / nspr / reference / pr_waitsemaphore.rst
blob1a0c7b3d1cc8bb59debb784e800c7ac8e0fca2bc
1 PR_WaitSemaphore
2 ================
4 Returns the value of the environment variable.
7 Syntax
8 ------
10 .. code::
12    #include <pripcsem.h>
14    NSPR_API(PRStatus) PR_WaitSemaphore(PRSem *sem);
17 Parameter
18 ~~~~~~~~~
20 The function has the following parameter:
22 ``sem``
23    A pointer to a ``PRSem`` structure returned from a call to
24    :ref:`PR_OpenSemaphore`.
27 Returns
28 ~~~~~~~
30 :ref:`PRStatus`
33 Description
34 -----------
36 :ref:`PR_WaitSemaphore` tests the value of the semaphore. If the value of
37 the semaphore is > 0, the value of the semaphore is decremented and the
38 function returns. If the value of the semaphore is 0, the function
39 blocks until the value becomes > 0, then the semaphore is decremented
40 and the function returns.
42 The "test and decrement" operation is performed atomically.