mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
[winpr,utils] Add Queue_Capacity
This commit is contained in:
@@ -93,6 +93,14 @@ extern "C"
|
||||
*/
|
||||
WINPR_API size_t Queue_Count(wQueue* queue);
|
||||
|
||||
/** @brief Return the allocated elements in the queue
|
||||
*
|
||||
* @param queue A pointer to a queue, must not be \b NULL
|
||||
*
|
||||
* @return the number of objects allocated
|
||||
*/
|
||||
WINPR_API size_t Queue_Capacity(wQueue* queue);
|
||||
|
||||
/** @brief Mutex-Lock a queue
|
||||
*
|
||||
* @param queue A pointer to a queue, must not be \b NULL
|
||||
|
||||
@@ -81,6 +81,19 @@ size_t Queue_Count(wQueue* queue)
|
||||
return ret;
|
||||
}
|
||||
|
||||
size_t Queue_Capacity(wQueue* queue)
|
||||
{
|
||||
WINPR_ASSERT(queue);
|
||||
|
||||
Queue_Lock(queue);
|
||||
|
||||
const size_t ret = queue->capacity;
|
||||
|
||||
Queue_Unlock(queue);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lock access to the ArrayList
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user