# CmtDiscardTSQ

int CmtDiscardTSQ (int 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 | integer | The handle you obtained from CmtNewTSQ to identify the thread safe queue.

## Return Value

Name | Type | Description
CmtStatus | integer | 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.