Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

PR_WaitSemaphore

Returns the value of the environment variable.

Syntax

#include <pripcsem.h>

NSPR_API(PRStatus) PR_WaitSemaphore(PRSem *sem);

Parameter

The function has the following parameter:

sem
A pointer to a PRSem structure returned from a call to PR_OpenSemaphore.

Returns

PRStatus

Description

PR_WaitSemaphore tests the value of the semaphore. If the value of the semaphore is > 0, the value of the semaphore is decremented and the function returns. If the value of the semaphore is 0, the function blocks until the value becomes > 0, then the semaphore is decremented and the function returns.

The "test and decrement" operation is performed atomically.

Document Tags and Contributors

 Contributors to this page: teoli, Rappo
 Last updated by: teoli,