summaryrefslogtreecommitdiff
path: root/source3/torture/bench_pthreadpool.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-03-24 10:39:56 +0000
committerJeremy Allison <jra@samba.org>2014-03-27 06:06:11 +0100
commitc5d07df6abe657ff196266bbfbb376ca7db0968b (patch)
tree926b6cf1b9444e90aa8e17f0c09d7a8df2a3433d /source3/torture/bench_pthreadpool.c
parent84aa2ddd861549d6ec8d1ef15f4fd518e03f449b (diff)
downloadsamba-c5d07df6abe657ff196266bbfbb376ca7db0968b.tar.gz
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/torture/bench_pthreadpool.c')
-rw-r--r--source3/torture/bench_pthreadpool.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/torture/bench_pthreadpool.c b/source3/torture/bench_pthreadpool.c
index ee0d2036b64..247063d9694 100644
--- a/source3/torture/bench_pthreadpool.c
+++ b/source3/torture/bench_pthreadpool.c
@@ -50,15 +50,15 @@ bool run_bench_pthreadpool(int dummy)
strerror(ret));
break;
}
- ret = pthreadpool_finished_job(pool, &jobid);
- if (ret != 0) {
+ ret = pthreadpool_finished_jobs(pool, &jobid, 1);
+ if (ret < 0) {
d_fprintf(stderr, "pthreadpool_finished_job failed: %s\n",
- strerror(ret));
+ strerror(-ret));
break;
}
}
pthreadpool_destroy(pool);
- return (ret == 0);
+ return (ret == 1);
}