mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-21 20:14:44 +00:00
Add accessors for refcount value
This commit is contained in:
parent
e807860fa9
commit
302a04b09c
@ -43,6 +43,11 @@ GIT_INLINE(void) git_atomic_set(git_atomic *a, int val)
|
|||||||
a->val = val;
|
a->val = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GIT_INLINE(int) git_atomic_get(git_atomic *a)
|
||||||
|
{
|
||||||
|
return (int)a->val;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef GIT_THREADS
|
#ifdef GIT_THREADS
|
||||||
|
|
||||||
#define git_thread pthread_t
|
#define git_thread pthread_t
|
||||||
|
@ -221,6 +221,9 @@ typedef void (*git_refcount_freeptr)(void *r);
|
|||||||
|
|
||||||
#define GIT_REFCOUNT_OWNER(r) (((git_refcount *)(r))->owner)
|
#define GIT_REFCOUNT_OWNER(r) (((git_refcount *)(r))->owner)
|
||||||
|
|
||||||
|
#define GIT_REFCOUNT_VAL(r) git_atomic_get(&((git_refcount *)(r))->refcount)
|
||||||
|
|
||||||
|
|
||||||
static signed char from_hex[] = {
|
static signed char from_hex[] = {
|
||||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 00 */
|
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 00 */
|
||||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 10 */
|
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 10 */
|
||||||
|
Loading…
Reference in New Issue
Block a user