Admin Production ni-theme
Current Publication

CmtDiscardTSQ

LabWindows/CVI

CmtDiscardTSQ

int CmtDiscardTSQ (CmtTSQHandle queueHandle);

Purpose

Destroys a thread safe queue and frees the resources used by it.

If there are threads currently reading or writing, this function waits for them to finish their operations before destroying the thread safe queue. Call CmtGetTSQAttribute with the TSQ_ATTR_READER_ACTIVE attribute to determine if a thread is reading from the queue. Call CmtGetTSQAttribute with the TSQ_ATTR_WRITER_ACTIVE attribute to determine if a thread is writing to the queue.

Parameters

Input
Name Type Description
queueHandle CmtTSQHandle The handle you obtained from CmtNewTSQ to identify the thread safe queue.

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 CmtDiscardTSQ function:

  • apps\daqmthread\daqMT.cws

    Open example
  • toolbox\asyncdem.cws

    Open example
  • utility\threading\ThreadSafeQueue\BuffNoDataLoss\BuffNoDataLoss.cws

    Open example
  • utility\threading\ThreadSafeQueue\DirectPtrAccess\DirectPtrAccess.cws

    Open example
  • utility\threading\ThreadSafeQueue\Overflow\Overflow.cws

    Open example