summaryrefslogtreecommitdiff
path: root/src/thread-utils.h
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2009-01-02 21:41:52 -0800
committerShawn O. Pearce <spearce@spearce.org>2009-01-02 21:41:52 -0800
commit11bb049bdddf1d203dfe8fd6031c4dba328a7525 (patch)
tree62860787aba2b59b1dd0bb7b9a810fbf3428cf75 /src/thread-utils.h
parentb438016ecda7648426036e66c4ed17fc93e71cfa (diff)
downloadlibgit2-11bb049bdddf1d203dfe8fd6031c4dba328a7525.tar.gz
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>
Diffstat (limited to 'src/thread-utils.h')
-rw-r--r--src/thread-utils.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/thread-utils.h b/src/thread-utils.h
index f5a98ad91..f8ed08a88 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. */