NXThreadInterrupt

Posts an interrupt to the specified thread.

Library:LibC
Classification:NKS
Service:Threads

Syntax

  #include <nks/thread.h> 
   
  int NXThreadInterrupt (
     NXThreadId_t      tid, 
     NXInterruptId_t   interId);
  

Parameters

tid

(IN) Specifies the ID of the thread to be interrupted.

interId

(IN) Specifies the interrupt to be posted: NX_INTR1 through NX_INTR64.

Return Values

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

Decimal

Hex

Constant

Description

9

0x09

NX_EINVAL

An invalid thread or interrupt ID is specified.

Remarks

NXThreadInterrupt posts an interrupt (exactly one of NX_INTR1 through and including NX_INTR64) specified by the interId parameter to the thread specified by the tid parameter.

The NKS layer does not interpret the specific interrupt being posted so applications are free to associate application-specific semantics to the set of interrupts they plan to use. Also, NKS does not queue interrupts. Posting multiple instances of a given interrupt results in only one instance of the interrupt being posted.

When an interrupted thread calls an interruptible function (see NXCondWait and NXCondTimedWait), the thread returns the NX_EINTR error. To clear the interrupted state of the thread, call NXThreadIsInterrupted.

For sample code, see ThrInter.c.

See Also