[winpr,utils] Add Queue_Capacity

This commit is contained in:
Armin Novak
2026-02-18 11:14:36 +01:00
parent b78cb455cb
commit d48452faf3
2 changed files with 21 additions and 0 deletions

View File

@@ -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

View File

@@ -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
*/