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/tests.c | |
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/tests.c')
-rw-r--r-- | source3/lib/pthreadpool/tests.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/lib/pthreadpool/tests.c b/source3/lib/pthreadpool/tests.c index 170cedf07f..847471297f 100644 --- a/source3/lib/pthreadpool/tests.c +++ b/source3/lib/pthreadpool/tests.c @@ -71,8 +71,8 @@ static int test_jobs(int num_threads, int num_jobs) for (i=0; i<num_jobs; i++) { int jobid = -1; - ret = pthreadpool_finished_job(p, &jobid); - if ((ret != 0) || (jobid >= num_jobs)) { + ret = pthreadpool_finished_jobs(p, &jobid, 1); + if ((ret != 1) || (jobid >= num_jobs)) { fprintf(stderr, "invalid job number %d\n", jobid); return -1; } @@ -284,8 +284,8 @@ static int test_threaded_addjob(int num_pools, int num_threads, int poolsize, continue; } - ret = pthreadpool_finished_job(pools[j], &jobid); - if ((ret != 0) || (jobid >= num_jobs * num_threads)) { + ret = pthreadpool_finished_jobs(pools[j], &jobid, 1); + if ((ret != 1) || (jobid >= num_jobs * num_threads)) { fprintf(stderr, "invalid job number %d\n", jobid); return -1; |