Commit 11bb049bdddf1d203dfe8fd6031c4dba328a7525

Shawn O. Pearce 2009-01-02T21:41:52

Fix pthread_mutex based gitrc_dec The function should return true only when the counter drops to 0. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/thread-utils.h b/src/thread-utils.h
index f5a98ad..f8ed08a 100644
--- a/src/thread-utils.h
+++ b/src/thread-utils.h
@@ -57,7 +57,7 @@ GIT_INLINE(int) gitrc_dec(git_refcnt *p)
 	gitlck_lock(&p->lock);
 	c = --p->counter;
 	gitlck_unlock(&p->lock);
-	return !!c;
+	return !c;
 }
 
 /** Free any resources associated with the counter. */