cniGetThreadContext

Returns the thread context for the current thread.

Syntax

CciThreadContext *cniGetThreadContext(
  int                    *returnCode,
  CciMessageContext      *msgContext);

Parameters

returnCode
This is the return code from the function (output). If the input is NULL, this signifies that errors are silently handled or are ignored by the broker. If the input is not NULL, the output signifies the success status of the call. If the msgContext parameter is not valid, then *returnCode is set to CCI_INV_MESSAGE_CONTEXT and a NULL CciThreadContext is returned.
msgContext
This provides the message context from which to acquire the thread-specific context. It is expected that this parameter is obtained by using the cniGetMessageContext utility function.

Return values

If this function is successful, it returns a handle to the CciThreadContext for the current thread.

The cciMessageContext value must correspond to a cciMessage, where the cciMessage is passed in to the cniEvaluate or cniRun function on the current thread.

Example

CciMessageContext* messageContext = cniGetMessageContext(NULL,message);
CciThreadContext*  threadContext  = cniGetThreadContext(NULL,messageContext);