C Collections

cthreadpool · Section 3

cthrpool_active_count

cthrpool_active_count - number of tasks that run now

C Collections (libccollections, -lccollections)

#include <ccollections/cthreadpool.h>
 
size_t cthrpool_active_count(cthrpool pool);

Returns a snapshot of how many tasks the worker threads are running at
the moment, that is, tasks that a worker has taken out of the queue
and that have not finished yet. The value can change as soon as the
call returns.

pool   Thread pool handle. CTHRPOOL_NULL, or a stale or
       already-destroyed handle, gives 0.

The number of tasks running at the moment, or 0 if pool is
CTHRPOOL_NULL or a stale or already-destroyed handle.

cthrpool_pending_count(3)