NXContextGet

Returns the identity of the currently executing context.

Library:LibC
Classification:NKS
Service:Threads

Syntax

  #include <nks/thread.h> 
   
  NXContext_t NXContextGet (void);
  

Return Values

If successful, returns a pointer to the currently executing context; otherwise, returns NULL.

Remarks

NXContextGet returns the currently executing context, which was previously created by calling NXContextAlloc. If the calling thread does not have an NKS context, it returns NULL.

The returned context is not guaranteed with respect to its state—nothing can be safely done with the returned context except to use the pointer in a comparison.

If you pass the returned pointer to NXThreadSwapContext, the behavior is unpredictable.

See Also