Pithikos/C-Thread-Pool

How to keep track of number of running threads?

Closed this issue · 2 comments

In may be a request for enhancement rather than an issue, but , is there a way to keep track of number of active threads at each time?

X= thpool->num_threads_working; gives me the following error:

Myprog.c:872:40: error: dereferencing pointer to incomplete type ‘struct thpool_’
X=thpool->num_threads_working;

Thanks,

I had a look at this and with commit @48ae25d35a83febdff1b921acc5e41c71a60fda7 you should be able and do that now. However you need to follow the API.

In your case:

X=thpool_num_threads_working(thpool);

Thanks for the quick enhancement! That worked great.