LabWindows/CVI

Content Type
Programming Language
Current manual

CmtGetThreadLocalVar

CmtGetThreadLocalVar

int CmtGetThreadLocalVar (CmtTLVHandle variableHandle, void *variablePointer);

Purpose

Gets a pointer to the thread local variable instance for the current thread.

The first time you call this function from a thread, the variable is initialized to the value pointed to by the variableInitialValue parameter that you passed to CmtNewThreadLocalVar.

Parameters

Input
Name Type Description
variableHandle CmtTLVHandle The handle you obtained from CmtNewThreadLocalVar to identify the thread local variable.
Output
Name Type Description
variablePointer void * Returns a pointer to the thread local variable instance for the current thread. Pass the address of a pointer to the type of the thread local variable.

Return Value

Name Type Description
cmtStatus int The CmtStatus code that the function call returns. This function returns 0 to indicate success and negative values to indicate failure. Pass the CmtStatus code to CmtGetErrorMessage to get a description of the error code.

Additional Information

Library: Utility Library

Include file: utility.h

LabWindows/CVI compatibility: LabWindows/CVI 5.5 and later

Examples

Refer to the following examples that use the CmtGetThreadLocalVar function:

  • utility\threading\ThreadLocalVar\ThreadLocalVar.cws

    Open example
  • utility\threading\ThreadPool\OnePanel\OnePanel.cws

    Open example
Was this information helpful?