]> git.proxmox.com Git - libgit2.git/commit - src/util/git2_util.h
Add a mutex and atomic counter abstraction and implementations
authorShawn O. Pearce <spearce@spearce.org>
Wed, 31 Dec 2008 21:20:21 +0000 (13:20 -0800)
committerShawn O. Pearce <spearce@spearce.org>
Wed, 31 Dec 2008 21:36:55 +0000 (13:36 -0800)
commit028ef0de72da1ad4d1b2ee4a125ede81e3f2ebed
tree480cc70e318d8a80657f36fb55967477050cf3ec
parentd44cfd460e2c52d67dea14838b03219967cf9cb9
Add a mutex and atomic counter abstraction and implementations

These abstractions can be used to implement an efficient resource
reference counter and simple mutual exclusion.  On pthreads we use
pthread_mutex_t, except when we are also on glibc and can directly
use its asm/atomic.h definitions.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
src/common.h
src/thread-utils.h
tests/t0002-refcnt.c [new file with mode: 0644]