pthreadpool: add pthreadpool_max_threads() and pthreadpool_queued_jobs() helpers
authorStefan Metzmacher <metze@samba.org>
Thu, 21 Jun 2018 22:49:33 +0000 (00:49 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 12 Jul 2018 12:25:18 +0000 (14:25 +0200)
commit505d298e81570bb118a9b82e5166a8f11139750b
treed5c39eb756e430939e9c7cd728fd4aea354f52b3
parent76474a6fad43c791293f4fb30dc7c155619c5dec
pthreadpool: add pthreadpool_max_threads() and pthreadpool_queued_jobs() helpers

These can be used to implement some kind of flow control in the caller.
E.g. unless pthreadpool_queued_jobs() is lower than
pthreadpool_max_threads() is good to prepare new jobs.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
lib/pthreadpool/pthreadpool.c
lib/pthreadpool/pthreadpool.h
lib/pthreadpool/pthreadpool_sync.c