diff options
author | Volker Lendecke <vl@samba.org> | 2014-03-24 10:39:56 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2014-03-27 06:06:11 +0100 |
commit | c5d07df6abe657ff196266bbfbb376ca7db0968b (patch) | |
tree | 926b6cf1b9444e90aa8e17f0c09d7a8df2a3433d /source3/lib/pthreadpool/pthreadpool.h | |
parent | 84aa2ddd861549d6ec8d1ef15f4fd518e03f449b (diff) | |
download | samba-c5d07df6abe657ff196266bbfbb376ca7db0968b.tar.gz samba-c5d07df6abe657ff196266bbfbb376ca7db0968b.tar.xz samba-c5d07df6abe657ff196266bbfbb376ca7db0968b.zip |
pthreadpool: Allow multiple jobs to be received
This can avoid syscalls when multiple jobs are finished simultaneously
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/lib/pthreadpool/pthreadpool.h')
-rw-r--r-- | source3/lib/pthreadpool/pthreadpool.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source3/lib/pthreadpool/pthreadpool.h b/source3/lib/pthreadpool/pthreadpool.h index fac2d25424..adb825a528 100644 --- a/source3/lib/pthreadpool/pthreadpool.h +++ b/source3/lib/pthreadpool/pthreadpool.h @@ -61,7 +61,7 @@ int pthreadpool_destroy(struct pthreadpool *pool); * * This adds a job to a pthreadpool. The job can be identified by * job_id. This integer will be returned from - * pthreadpool_finished_job() then the job is completed. + * pthreadpool_finished_jobs() then the job is completed. * * @param[in] pool The pool to run the job on * @param[in] job_id A custom identifier @@ -84,15 +84,18 @@ int pthreadpool_add_job(struct pthreadpool *pool, int job_id, int pthreadpool_signal_fd(struct pthreadpool *pool); /** - * @brief Get the job_id of a finished job + * @brief Get the job_ids of finished jobs * * This blocks until a job has finished unless the fd returned by * pthreadpool_signal_fd() is readable. * * @param[in] pool The pool to query for finished jobs - * @param[out] pjobid The job_id of the finished job - * @return success: 0, failure: errno + * @param[out] jobids The job_ids of the finished job + * @param[int] num_jobids The job_ids array size + * @return success: >=0, number of finished jobs + * failure: -errno */ -int pthreadpool_finished_job(struct pthreadpool *pool, int *jobid); +int pthreadpool_finished_jobs(struct pthreadpool *pool, int *jobids, + unsigned num_jobids); #endif |