mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-06 11:19:47 +00:00
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>
This commit is contained in:
parent
b438016ecd
commit
11bb049bdd
@ -57,7 +57,7 @@ GIT_INLINE(int) gitrc_dec(git_refcnt *p)
|
|||||||
gitlck_lock(&p->lock);
|
gitlck_lock(&p->lock);
|
||||||
c = --p->counter;
|
c = --p->counter;
|
||||||
gitlck_unlock(&p->lock);
|
gitlck_unlock(&p->lock);
|
||||||
return !!c;
|
return !c;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Free any resources associated with the counter. */
|
/** Free any resources associated with the counter. */
|
||||||
|
Loading…
Reference in New Issue
Block a user