NXThreadIsInterrupted

Returns the pending interrupt state of the calling thread.

Library:LibC
Classification:NKS
Service:Threads

Syntax

  #include <nks/thread.h> 
   
  NXBool_t NXThreadIsInterrupted (
     NXInterruptSet_t  *set);
  

Parameters

set

(OUT) Points to the pending interrupt state of the calling thread and clears it. If set is passed in as NULL, the interrupt state for the calling thread is not cleared, but NXThreadIsInterrupted returns whether an interrupt is pending.

Return Values

Returns TRUE if the calling thread was interrupted, or FALSE if the calling thread has no pending interrupts.

Remarks

NXThreadIsInterrupted (in conjunction with NXProcessInterruptSet) provides the framework to structure application-specific handling of inter-thread interrupts. If the set parameter is not NULL, NXThreadIsInterrupted retrieves a snapshot of the pending interrupts. The application then must process any interrupts in the set by calling NXProcessInterruptSet.

If set is a NULL pointer, NXThreadIsInterrupted can be used as an interrupt polling mechanism to verify whether the calling thread has any pending interrupts without changing the interrupt state of the thread. You can use this functionality to check for pending interrupts without having to process any pending interrupts.

For sample code, see ThrInter.c.

See Also