thr_setprio

Sets the priority of the specified thread.

Library:LibC
Classification:UNIX International
Service:Threads

Syntax

  #include <thread.h> 
   
  int thr_setprio (
     thread_t   thr,
     int        pri);
  

Parameters

thr

(IN) Specifies the thread.

pri

(IN) Specifies the priority of the target thread with one of the following flags:

Flag

Value

Description

NX_PRIO_HIGH

10

High priority

NX_PRIO_MED

5

Medium priority

NX_PRIO_LOW

1

Low priority

Return Values

If successful, returns 0; otherwise, returns a nonzero error code:

Decimal

Constant

Description

9

NX_EINVAL

Invalid priority value.

77

NX_ESRCH

The specified thread ID is invalid

Remarks

The thr_setprio function associates a priority with the specified thread. Currently, all threads run at the same priority, regardless of the priority value associated with them.

See Also