summaryrefslogtreecommitdiffstats
path: root/docs/nspr/reference/locks.rst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /docs/nspr/reference/locks.rst
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'docs/nspr/reference/locks.rst')
-rw-r--r--docs/nspr/reference/locks.rst42
1 files changed, 42 insertions, 0 deletions
diff --git a/docs/nspr/reference/locks.rst b/docs/nspr/reference/locks.rst
new file mode 100644
index 0000000000..5ab57102c1
--- /dev/null
+++ b/docs/nspr/reference/locks.rst
@@ -0,0 +1,42 @@
+This chapter describes the NSPR API for creation and manipulation of a
+mutex of type :ref:`PRLock`.
+
+- `Lock Type <#Lock_Type>`__
+- `Lock Functions <#Lock_Functions>`__
+
+In NSPR, a mutex of type :ref:`PRLock` controls locking, and associated
+condition variables communicate changes in state among threads. When a
+programmer associates a mutex with an arbitrary collection of data, the
+mutex provides a protective monitor around the data.
+
+In general, a monitor is a conceptual entity composed of a mutex, one or
+more condition variables, and the monitored data. Monitors in this
+generic sense should not be confused with monitors used in Java
+programming. In addition to :ref:`PRLock`, NSPR provides another mutex
+type, :ref:`PRMonitor`, which is reentrant and can have only one associated
+condition variable. :ref:`PRMonitor` is intended for use with Java and
+reflects the Java approach to thread synchronization.
+
+For an introduction to NSPR thread synchronization, including locks and
+condition variables, see `Introduction to
+NSPR <Introduction_to_NSPR>`__.
+
+For reference information on NSPR condition variables, see `Condition
+Variables <Condition_Variables>`__.
+
+.. _Lock_Type:
+
+Lock Type
+---------
+
+ - :ref:`PRLock`
+
+.. _Lock_Functions:
+
+Lock Functions
+--------------
+
+ - :ref:`PR_NewLock` creates a new lock object.
+ - :ref:`PR_DestroyLock` destroys a specified lock object.
+ - :ref:`PR_Lock` locks a specified lock object.
+ - :ref:`PR_Unlock` unlocks a specified lock object.