summaryrefslogtreecommitdiffstats
path: root/docs/nspr/reference/pr_jointhread.rst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /docs/nspr/reference/pr_jointhread.rst
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'docs/nspr/reference/pr_jointhread.rst')
-rw-r--r--docs/nspr/reference/pr_jointhread.rst57
1 files changed, 57 insertions, 0 deletions
diff --git a/docs/nspr/reference/pr_jointhread.rst b/docs/nspr/reference/pr_jointhread.rst
new file mode 100644
index 0000000000..a1bfddf81c
--- /dev/null
+++ b/docs/nspr/reference/pr_jointhread.rst
@@ -0,0 +1,57 @@
+PR_JoinThread
+=============
+
+Blocks the calling thread until a specified thread terminates.
+
+
+Syntax
+------
+
+.. code::
+
+ #include <prthread.h>
+
+ PRStatus PR_JoinThread(PRThread *thread);
+
+
+Parameter
+~~~~~~~~~
+
+:ref:`PR_JoinThread` has the following parameter:
+
+``thread``
+ A valid identifier for the thread that is to be joined.
+
+
+Returns
+~~~~~~~
+
+The function returns one of the following values:
+
+- If successful, ``PR_SUCCESS``
+- If unsuccessful--for example, if no joinable thread can be found that
+ corresponds to the specified target thread, or if the target thread
+ is unjoinable--``PR_FAILURE``.
+
+
+Description
+-----------
+
+:ref:`PR_JoinThread` is used to synchronize the termination of a thread.
+The function is synchronous in that it blocks the calling thread until
+the target thread is in a joinable state. :ref:`PR_JoinThread` returns to
+the caller only after the target thread returns from its root function.
+
+:ref:`PR_JoinThread` must not be called until after :ref:`PR_CreateThread` has
+returned. If :ref:`PR_JoinThread` is not called on the same thread as
+:ref:`PR_CreateThread`, then it is the caller's responsibility to ensure
+that :ref:`PR_CreateThread` has completed.
+
+Several threads cannot wait for the same thread to complete. One of the
+calling threads operates successfully, and the others terminate with the
+error ``PR_FAILURE``.
+
+The calling thread is not blocked if the target thread has already
+terminated.
+
+:ref:`PR_JoinThread` is interruptible.