summaryrefslogtreecommitdiffstats
path: root/docs/nspr/reference/pr_setthreadpriority.rst
blob: 32ca051656f1141f3beb6fd28b837565beffb0df (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
PR_SetThreadPriority
====================

Sets the priority of a specified thread.


Syntax
------

.. code::

   #include <prthread.h>

   void PR_SetThreadPriority(
      PRThread *thread,
      PRThreadPriority priority);


Parameters
~~~~~~~~~~

:ref:`PR_SetThreadPriority` has the following parameters:

``thread``
   A valid identifier for the thread whose priority you want to set.
``priority``
   The priority you want to set.


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

Modifying the priority of a thread other than the calling thread is
risky. It is difficult to ensure that the state of the target thread
permits a priority adjustment without ill effects. It is preferable for
a thread to specify itself in the thread parameter when it calls
:ref:`PR_SetThreadPriority`.