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>
Showing
tests/t0002-refcnt.c
0 → 100644
Please
register
or
sign in
to comment