summaryrefslogtreecommitdiff
path: root/lib/pthreadpool/pthreadpool_sync.c
AgeCommit message (Collapse)AuthorFilesLines
2019-01-11Revert "pthreadpool: call unshare(CLONE_FS) if available"Ralph Boehme1-5/+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>
2019-01-11Revert "pthreadpool: add pthreadpool_restart_check[_monitor_{fd,drain}]()"Ralph Boehme1-20/+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>
2018-07-24pthreadpool: add pthreadpool_restart_check[_monitor_{fd,drain}]()Stefan Metzmacher1-0/+20
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>
2018-07-24pthreadpool: call unshare(CLONE_FS) if availableRalph Boehme1-0/+5
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>
2018-07-12pthreadpool: split out a pthreadpool_stop() from pthreadpool_destroy()Stefan Metzmacher1-0/+13
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>
2018-07-12pthreadpool: add pthreadpool_cancel_job()Stefan Metzmacher1-0/+6
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-07-12pthreadpool: add pthreadpool_max_threads() and pthreadpool_queued_jobs() helpersStefan Metzmacher1-0/+10
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>
2017-02-09Move pthreadpool to top of the tree.Matthieu Patou1-0/+68
Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Jeremy Allison <jra@samba.org>