summaryrefslogtreecommitdiffstats
path: root/docs/nspr/reference/prthreadtype.rst
blob: 4934af7a2ff754a71c1670a373661566a4fd035f (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
PRThreadType
============

The type of an NSPR thread, specified as a parameter to
:ref:`PR_CreateThread`.


Syntax
------

.. code::

   #include <prthread.h>

   typedef enum PRThreadType {
      PR_USER_THREAD,
      PR_SYSTEM_THREAD
   } PRThreadType;


Enumerators
~~~~~~~~~~~

``PR_USER_THREAD``
   :ref:`PR_Cleanup` blocks until the last thread of type
   ``PR_USER_THREAD`` terminates.
``PR_SYSTEM_THREAD``
   NSPR ignores threads of type ``PR_SYSTEM_THREAD`` when determining
   when a call to :ref:`PR_Cleanup` should return.


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

Threads can be either user threads or system threads. NSPR allows the
client to synchronize the termination of all user threads and ignores
those created as system threads. This arrangement implies that a system
thread should not have volatile data that needs to be safely stored
away. The applicability of system threads is somewhat dubious;
therefore, they should be used with caution.