summaryrefslogtreecommitdiff
path: root/lib/pthreadpool
Commit message (Collapse)AuthorAgeFilesLines
* lib:pthreadpool: Fix code spellingAndreas Schneider2023-04-111-1/+1
| | | | | | Best reviewed with: `git show --word-diff`. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
* build: Do not build selftest binaries for builds without --enable-selftestAndrew Bartlett2019-11-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new for_selftest option to SAMBA_BINARY() and SAMBA3_BINARY() This allows us to be much more consistent (at least in the core Samba) and documents clearly why the binary should not be installed. Not modified are - test_lp_load - notifyd-tests - gendrandperf - test* from examples/libsmbclient - dbwrap_torture - split_tokens - locktest2 - msgtest - msg_sink - msg_source - versiontest - rpc_open_tcp - test_headers As these are not tested in selftest so any change would also be untested. Of course they probably should be added in a different MR. Also not modified (because they are not tests, nor part of the build system) are: - smb2mount - notifydd - log2pacp - debug2html - smbfilter - destroy_netlogon_creds_cli - spotlight2* - tevent_glib_tracker These do however appear to be untested. For now, the source4 forked client tools are left unchanged: - smbclient4 - nmblookup4 Finally, the heimdal binaries are left as install=False as they are either part of the build system or end-user tools that we just don't want to install. These are however tested. The motivation is commit like c34ec003b7d45aa4196ff93a0ac29694b25e5309 and da87fa998ab71328f30bcdf5b41aee8675aee48a, which are both totally correct but are not needed if the selftest is not run on MacOS. There are likely other platforms or build environments where building our test binaries is more pain than valuable, see for example also https://lists.samba.org/archive/samba/2019-November/227137.html Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Isaac Boukris <iboukris@samba.org> Autobuild-User(master): Isaac Boukris <iboukris@samba.org> Autobuild-Date(master): Fri Nov 22 11:48:59 UTC 2019 on sn-devel-184
* pthreadpool: Only link pthreadpool against librt if we have toAndreas Schneider2019-09-251-1/+6
| | | | | | | | | | | | | | This calls clock_gettime() which is available in glibc on Linux. If the wscript in libreplace detected that librt is needed for clock_gettime() we have to link against it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14140 Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Isaac Boukris <iboukris@gmail.com> Pair-Programmed-With: Isaac Boukris <iboukris@gmail.com> Reviewed-by: Matthias Dieter Wallnöfer <mdw@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* pthreadpool: Remove wrong comment.Christof Schmitt2019-08-231-4/+0
| | | | | | | | | | | | Commit e45d33e9 removed the sync fallback path for the case that no thread could be created. Remove the comment for that fallback as it does not make sense anymore. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Fri Aug 23 23:09:12 UTC 2019 on sn-devel-184
* lib/pthreadpool: cppcheck: Fix Memory leakNoel Power2019-06-041-0/+6
| | | | | | | | | Fixes lib/pthreadpool/tests.c:63: error: memleak: Memory leak: finished <--[cppcheck] Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org>
* Revert "pthreadpool: split out pthreadpool_tevent_job from ↵Ralph Boehme2019-01-111-172/+66
| | | | | | | | | | | | | | | | pthreadpool_tevent_job_state" This reverts commit 245d684d28dab630f3d47ff61006a1fe3e5eeefa. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "pthreadpool: add pthreadpool_tevent_job_cancel()"Ralph Boehme2019-01-111-40/+0
| | | | | | | | | | | | | | This reverts commit 791c05144ee9296024cc0fdebe4afeaaf67e26bc. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "pthreadpool: maintain a global list of orphaned pthreadpool_tevent_jobs"Ralph Boehme2019-01-112-43/+0
| | | | | | | | | | | | | | This reverts commit 25756425aaf5465e56ea809cd415b6a387848919. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "pthreadpool: add some lockless coordination between the main and job ↵Ralph Boehme2019-01-112-221/+5
| | | | | | | | | | | | | | | | threads" This reverts commit 9656b8d8ee11ee351870286f16ea8fbe49112292. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "pthreadpool: add helgrind magic to PTHREAD_TEVENT_JOB_THREAD_FENCE_*()"Ralph Boehme2019-01-111-34/+0
| | | | | | | | | | | | | | This reverts commit 9b73fda926eb8493e80012794483039be66d4e6c. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "pthreadpool: maintain a list of job_states on each ↵Ralph Boehme2019-01-111-78/+24
| | | | | | | | | | | | | | | | pthreadpool_tevent_glue" This reverts commit aa9b64eccfd037941512bad108c4e3946714a502. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "pthreadpool: add a comment about a further optimization in ↵Ralph Boehme2019-01-111-17/+0
| | | | | | | | | | | | | | | | pthreadpool_tevent_job_destructor()" This reverts commit f23cac39b36b026650e0922c78fe0fd3fe567e35. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "pthreadpool: test cancelling and freeing pending pthreadpool_tevent ↵Ralph Boehme2019-01-111-434/+0
| | | | | | | | | | | | | | | | jobs/pools" This reverts commit 40d15260d24d0071732f47873f395fce29b8a6f4. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "pthreadpool: add pthreadpool_tevent_[current_job_]per_thread_cwd()"Ralph Boehme2019-01-112-33/+0
| | | | | | | | | | | | | | This reverts commit 12a45ee1a66379ba7562729b835ce0e2e4bfb3b3. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "pthreadpool: add tests for ↵Ralph Boehme2019-01-111-144/+0
| | | | | | | | | | | | | | | | pthreadpool_tevent_[current_job_]per_thread_cwd()" This reverts commit fbafdc99ef2cef11a1a28e795ffe965cb53ef7fa. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "pthreadpool: call unshare(CLONE_FS) if available"Ralph Boehme2019-01-113-56/+0
| | | | | | | | | | | | | | This reverts commit 65e4742d168454df6507d9e74993749063435dd6. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "pthreadpool: add pthreadpool_restart_check[_monitor_{fd,drain}]()"Ralph Boehme2019-01-113-365/+0
| | | | | | | | | | | | | | This reverts commit 3c4cdb290723432b00ff9ff88b892cb4e66e76cd. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "pthreadpool: implement pthreadpool_tevent_wrapper_create() ↵Ralph Boehme2019-01-112-433/+1
| | | | | | | | | | | | | | | | infrastructure" This reverts commit f9745d8b5234091c38e93ed57a255120b61f3ad7. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "pthreadpool: test cancelling and freeing jobs of a wrapped ↵Ralph Boehme2019-01-111-573/+0
| | | | | | | | | | | | | | | | pthreadpool_tevent" This reverts commit fb6b6cf3e43165ced4b1039f2683d19f277c0792. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "pthreadpool: we need to use pthreadpool_tevent_per_thread_cwd() on ↵Ralph Boehme2019-01-111-2/+1
| | | | | | | | | | | | | | | | the callers pool" This reverts commit ff863f2d98ac5e12073af824b794404c3d7198c5. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "pthreadpool: ignore the return value of poll(NULL, 0UL, 1)"Ralph Boehme2019-01-111-2/+2
| | | | | | | | | | | | | | This reverts commit 6da0d68f49bbd82f5a08427779c9f5ebd6f755aa. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "pthreadpool: reset monitor_fd after calling tevent_fd_set_auto_close()"Ralph Boehme2019-01-111-1/+0
| | | | | | | | | | | | | | This reverts commit f68b5ee75f002ed542a8423070fb01e3b0e83f65. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* pthreadpool: reset monitor_fd after calling tevent_fd_set_auto_close()Stefan Metzmacher2018-07-311-0/+1
| | | | | | | | | | This tries to convince Coverity that we don't have a resource leak: CID 1438157: (RESOURCE_LEAK) Handle variable "monitor_fd" going out of scope leaks the handle. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* pthreadpool: ignore the return value of poll(NULL, 0UL, 1)Stefan Metzmacher2018-07-311-2/+2
| | | | | | | | | | | Otherwise Coverity reports this: CID 1438160: (CHECKED_RETURN) Calling "poll(NULL, 0UL, 1)" without checking return value. This library function may fail and return an error code. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* pthreadpool: we need to use pthreadpool_tevent_per_thread_cwd() on the ↵Stefan Metzmacher2018-07-271-1/+2
| | | | | | | | | | | | callers pool In pthreadpool_tevent_job_send() we remember if the job will be chdir safe. It means we means we need to ask the callers pool when calling pthreadpool_tevent_per_thread_cwd(), as the callers pool might be a wrapper using pthreadpool_tevent_force_per_thread_cwd(). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* pthreadpool: add a missing includeRalph Boehme2018-07-252-0/+2
| | | | | | | Reported-by: David Disseldorp <ddiss@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* pthreadpool: test cancelling and freeing jobs of a wrapped pthreadpool_teventRalph Boehme2018-07-241-0/+573
| | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* pthreadpool: implement pthreadpool_tevent_wrapper_create() infrastructureStefan Metzmacher2018-07-242-1/+433
| | | | | | | | This can be used implement a generic per thread impersonation for thread pools. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* pthreadpool: add pthreadpool_restart_check[_monitor_{fd,drain}]()Stefan Metzmacher2018-07-243-0/+365
| | | | | | | | This makes it possible to monitor the pthreadpool for exited worker threads and may restart new threads from the main thread again. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* pthreadpool: add tests for pthreadpool_tevent_[current_job_]per_thread_cwd()Stefan Metzmacher2018-07-241-0/+144
| | | | | | | | | Note this currently this doesn't enforce the support for unshare(CLONE_FS) as some contraint container environment (e.g. docker) reject the whole unshare() system call. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* pthreadpool: add pthreadpool_tevent_[current_job_]per_thread_cwd()Stefan Metzmacher2018-07-242-0/+33
| | | | | | | | This can be used to check if worker threads run with unshare(CLONE_FS). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* pthreadpool: call unshare(CLONE_FS) if availableRalph Boehme2018-07-243-0/+56
| | | | | | | | | | | | This paves the way for pthreadpool jobs that are path based. Callers can use pthreadpool_per_thread_cwd() to check if the current pool supports it. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org>
* pthreadpool: test cancelling and freeing pending pthreadpool_tevent jobs/poolsRalph Boehme2018-07-241-0/+434
| | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* pthreadpool: add a comment about a further optimization in ↵Stefan Metzmacher2018-07-241-0/+17
| | | | | | | | | | pthreadpool_tevent_job_destructor() This seems to be a really rare race, it's likely that the immediate event will still trigger and cleanup. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* pthreadpool: maintain a list of job_states on each pthreadpool_tevent_glueStefan Metzmacher2018-07-241-24/+78
| | | | | | | | | | | | | | | We should avoid traversing a linked list within a thread without holding a mutex! Using a mutex would be very tricky as we'll likely deadlock with the mutexes at the raw pthreadpool layer. So we use somekind of spinlock using atomic_thread_fence in order to protect the access to job->state->glue->{tctx,ev} in pthreadpool_tevent_job_signal(). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* pthreadpool: add helgrind magic to PTHREAD_TEVENT_JOB_THREAD_FENCE_*()Stefan Metzmacher2018-07-241-0/+34
| | | | | | | | This avoids the expected helgrind/drd warnings on the job states which are protected by the thread fence. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* pthreadpool: add some lockless coordination between the main and job threadsStefan Metzmacher2018-07-242-5/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the direction from the main process to the job thread, we have: - 'maycancel', which is set when tevent_req_cancel() is called, - 'orphaned' is the job request, tevent_context or pthreadpool_tevent was talloc_free'ed. The job function can consume these by using: /* * return true - if tevent_req_cancel() was called. */ bool pthreadpool_tevent_current_job_canceled(void); /* * return true - if talloc_free() was called on the job request, * tevent_context or pthreadpool_tevent. */ bool pthreadpool_tevent_current_job_orphaned(void); /* * return true if canceled and orphaned are both false. */ bool pthreadpool_tevent_current_job_continue(void); In the other direction we remember the following points in the job execution: - 'started' - set when the job is picked up by a worker thread - 'executed' - set once the job function returned. - 'finished' - set when pthreadpool_tevent_job_signal() is entered - 'dropped' - set when pthreadpool_tevent_job_signal() leaves with orphaned - 'signaled' - set when pthreadpool_tevent_job_signal() leaves normal There're only one side writing each element, either the main process or the job thread. This means we can do the coordination with a full memory barrier using atomic_thread_fence(memory_order_seq_cst). lib/replace provides fallbacks if C11 stdatomic.h is not available. A real pthreadpool requires pthread and atomic_thread_fence() (or an replacement) to be available, otherwise we only have pthreadpool_sync.c. But this should not make a real difference, as at least __sync_synchronize() is availabe since 2005 in gcc. We also require __thread which is available since 2002. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* pthreadpool: replace assert_return_code(ret, 0); with assert_int_equal(ret, 0);Stefan Metzmacher2018-07-241-3/+3
| | | | | | | We need to assert the exact value! Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* pthreadpool: test pthreadpool_tevent_max_threads() returns the expected resultStefan Metzmacher2018-07-241-0/+10
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* pthreadpool: make sure a pthreadpool is marked as stopped in child processesStefan Metzmacher2018-07-241-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* pthreadpool: allocate glue->tctx on glue as memory context.Stefan Metzmacher2018-07-121-1/+1
| | | | | | | | | | This means it will go aways together with glue and thte event context. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Jul 12 17:18:01 CEST 2018 on sn-devel-144
* pthreadpool: maintain a global list of orphaned pthreadpool_tevent_jobsStefan Metzmacher2018-07-122-0/+43
| | | | | | | | | | | Instead of leaking the memory forever, we retry the cleanup, if other pthreadpool_tevent_*() functions are used. pthreadpool_tevent_cleanup_orphaned_jobs() could also be called by external callers. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* pthreadpool: make use of pthreadpool_stop() in pthreadpool_tevent_destructor()Stefan Metzmacher2018-07-121-2/+7
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* pthreadpool: add pthreadpool_tevent_job_cancel()Stefan Metzmacher2018-07-121-0/+40
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* pthreadpool: split out pthreadpool_tevent_job from pthreadpool_tevent_job_stateStefan Metzmacher2018-07-121-66/+172
| | | | | | | | | | | This makes it much easier to handle orphaned jobs, we either wait for the immediate tevent to trigger or we just keep leaking the memory. The next commits will improve this further. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* pthreadpool: let pthreadpool_tevent_job_send() fail with an invalid poolStefan Metzmacher2018-07-121-0/+9
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* pthreadpool: split out a pthreadpool_stop() from pthreadpool_destroy()Stefan Metzmacher2018-07-123-26/+129
| | | | | | | | This can be used in combination with pthreadpool_cancel_job() to implement a multi step shutdown of the pool. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* pthreadpool: don't process further jobs when shutting downStefan Metzmacher2018-07-121-3/+6
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* pthreadpool: add pthreadpool_cancel_job()Stefan Metzmacher2018-07-123-0/+78
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* pthreadpool: add pthreadpool_tevent_max_threads() and ↵Stefan Metzmacher2018-07-122-0/+21
| | | | | | | | | | | pthreadpool_tevent_queued_jobs() These can be used to implement some kind of flow control in the caller. E.g. unless pthreadpool_tevent_queued_jobs() is lower than pthreadpool_tevent_max_threads() is good to prepare new jobs. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>