Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/docs/nspr/reference/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 784 B image not shown  

Quelle  pr_waitsemaphore.rst   Sprache: unbekannt

 
PR_WaitSemaphore
================

Returns the value of the environment variable.


Syntax
------

.. code::

   #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
   :ref:`PR_OpenSemaphore`.


Returns
~~~~~~~

:ref:`PRStatus`


Description
-----------

:ref:`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.

[ Dauer der Verarbeitung: 0.37 Sekunden  (vorverarbeitet)  ]