CmtFlushTSQ
- Updated2023-02-21
- 2 minute(s) read
int CmtFlushTSQ (CmtTSQHandle queueHandle, int itemsToFlush, int *itemsFlushed);
Purpose
Removes items from the thread safe queue.
You can use this function to reset the queue to a known state when you lose data due to queue overflow. This function waits until threads that are currently reading from or writing to the thread safe queue finish their operations before flushing any items.
Parameters
Input | ||
Name | Type | Description |
queueHandle | CmtTSQHandle | The handle you obtained from CmtNewTSQ to identify the thread safe queue. |
itemsToFlush | int | The number of items to remove from the thread safe queue. Pass TSQ_FLUSH_ALL to remove all of the items from the queue. |
Output | ||
Name | Type | Description |
itemsFlushed | int | Returns the number of items that the thread safe queue removed from the beginning of the queue to make room for the new data. Pass NULL if you do not want this value. |
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