[med-svn] [htslib] 13/13: Squash a duplicated conditional into a single one.
Andreas Tille
tille at debian.org
Sat Jan 30 13:23:57 UTC 2016
This is an automated email from the git hooks/post-receive script.
tille pushed a commit to branch master
in repository htslib.
commit 406c7d0a1790e9c0d7393696be06c3e6d0653a2d
Author: James Bonfield <jkb at sanger.ac.uk>
Date: Wed Jan 27 17:54:38 2016 +0000
Squash a duplicated conditional into a single one.
It was already done this way in the original t_pool_dispatch()
function, but apparently not in the non-blocking variant.
---
cram/thread_pool.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/cram/thread_pool.c b/cram/thread_pool.c
index cb04f01..cf80edb 100644
--- a/cram/thread_pool.c
+++ b/cram/thread_pool.c
@@ -524,19 +524,13 @@ int t_pool_dispatch2(t_pool *p, t_results_queue *q,
j->q = q;
if (q) {
pthread_mutex_lock(&q->result_m);
- j->serial = q->curr_serial;
+ j->serial = q->curr_serial++;
+ q->pending++;
pthread_mutex_unlock(&q->result_m);
} else {
j->serial = 0;
}
- if (q) {
- pthread_mutex_lock(&q->result_m);
- q->curr_serial++;
- q->pending++;
- pthread_mutex_unlock(&q->result_m);
- }
-
// Check if queue is full
if (nonblock == 0)
while (p->njobs >= p->qsize)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/htslib.git
More information about the debian-med-commit
mailing list