Posts an interrupt to the specified thread.
#include <nks/thread.h>
int NXThreadInterrupt (
NXThreadId_t tid,
NXInterruptId_t interId);
(IN) Specifies the ID of the thread to be interrupted.
(IN) Specifies the interrupt to be posted: NX_INTR1 through NX_INTR64.
If successful, returns 0; otherwise, returns a nonzero error code:
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.