NXThreadGetPriority

Returns the scheduling priority of the context that is bound to the specified thread.

Library:LibC
Classification:NKS
Service:Threads

Syntax

  #include <nks/thread.h>
   
  int NXThreadGetPriority (
     NXThreadId_t   tid,   
     int           *priority);
  

Parameters

tid

(IN) Specifies the target thread ID.

priority

(OUT) Points to the location where the priority of the target thread is returned. Valid priorities are specified with 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

Hex

Constant

Description

77

0x4D

NX_ESRCH

The specified thread ID is invalid

Remarks

A thread assumes the priority of the context it is currently hosting.

For sample code, see Priority.c.

See Also