NXThreadSetPriority

Sets the scheduling priority of the specified thread.

Library:LibC
Classification:NKS
Service:Threads

Syntax

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

Parameters

tid

(IN) Specifies the ID of the target thread.

priority

(IN) Specifies the priority value to be set:

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

9

0x09

NX_EINVAL

Invalid priority value.

77

0x4D

NX_ESRCH

The specified thread ID is invalid

Remarks

NKS maintains execution priority as part of the context state. Hence, a priority change effected by calling NXThreadSetPriority modifies the priority of the context currently bound to the specified thread.

NXThreadSetPriority is also valid for worker threads.

NOTE:Because the NetWare scheduler does not currently support priority, this call has no effect on NetWare.

For sample code, see Priority.c.

See Also