summaryrefslogtreecommitdiff
path: root/src/cache.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-03-17 22:11:35 +0200
committerVicent Marti <tanoku@gmail.com>2011-03-17 22:16:54 +0200
commitcb3e1334e8a5c3003fa0419442fc06d45508ac31 (patch)
tree6be2facd0014fff4a4769b6a6a082c722c03ad87 /src/cache.c
parent12d67a2a4e7f673e6239ac8865dfe8cb6ddcae53 (diff)
downloadlibgit2-threadsafe.tar.gz
Fix the threading implementationthreadsafe
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cache.c b/src/cache.c
index cabd286ab..5a9b8415c 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -39,12 +39,12 @@ GIT_INLINE(int) cached_obj_compare(git_cached_obj *obj, const git_oid *oid)
GIT_INLINE(void) cached_obj_incref(git_cached_obj *obj)
{
- obj->refcount++;
+ git_atomic_inc(&obj->refcount);
}
GIT_INLINE(void) cached_obj_decref(git_cached_obj *obj, git_cached_obj_freeptr free_obj)
{
- if (--obj->refcount == 0)
+ if (git_atomic_dec(&obj->refcount) == 0)
free_obj(obj);
}