summaryrefslogtreecommitdiffstats
path: root/docs/nspr/reference/pr_lock.rst
blob: 53cb17deeabc4cb5c4fafa2b33e4397f590f5f5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
PR_Lock
=======

Locks a specified lock object.


Syntax
------

.. code::

   #include <prlock.h>

   void PR_Lock(PRLock *lock);


Parameter
~~~~~~~~~

:ref:`PR_Lock` has one parameter:

``lock``
   A pointer to a lock object to be locked.


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

When :ref:`PR_Lock` returns, the calling thread is "in the monitor," also
called "holding the monitor's lock." Any thread that attempts to acquire
the same lock blocks until the holder of the lock exits the monitor.
Acquiring the lock is not an interruptible operation, nor is there any
timeout mechanism.

:ref:`PR_Lock` is not reentrant. Calling it twice on the same thread
results in undefined behavior.


See Also
--------

 - :ref:`PR_Unlock`