tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

pr_notify.rst (1153B)


      1 PR_Notify
      2 =========
      3 
      4 Notifies a monitor that a change in state of the monitored data has
      5 occurred.
      6 
      7 
      8 Syntax
      9 ------
     10 
     11 .. code::
     12 
     13   #include <prmon.h>
     14 
     15   PRStatus PR_Notify(PRMonitor *mon);
     16 
     17 
     18 Parameters
     19 ~~~~~~~~~~
     20 
     21 The function has the following parameter:
     22 
     23 ``mon``
     24   A reference to an existing structure of type :ref:`PRMonitor`. The
     25   monitor object referenced must be one for which the calling thread
     26   currently holds the lock.
     27 
     28 
     29 Returns
     30 ~~~~~~~
     31 
     32 The function returns one of the following values:
     33 
     34 -  If successful, ``PR_SUCCESS``.
     35 -  If unsuccessful, ``PR_FAILURE``.
     36 
     37 
     38 Description
     39 -----------
     40 
     41 Notification of a monitor signals the change of state of some monitored
     42 data. The changing of that data and the notification must all be
     43 performed while in the monitor. When the notification occurs, the
     44 runtime promotes a thread that is waiting on the monitor to a ready
     45 state. If more than one thread is waiting, the selection of which thread
     46 gets promoted cannot be determined in advance. This implies that all
     47 threads waiting on a single monitor must have the same semantics. If no
     48 thread is waiting on the monitor, the notify operation is a no-op.