diff options
| author | Shawn O. Pearce <spearce@spearce.org> | 2008-12-31 13:20:21 -0800 |
|---|---|---|
| committer | Shawn O. Pearce <spearce@spearce.org> | 2008-12-31 13:36:55 -0800 |
| commit | 028ef0de72da1ad4d1b2ee4a125ede81e3f2ebed (patch) | |
| tree | 480cc70e318d8a80657f36fb55967477050cf3ec /src/common.h | |
| parent | d44cfd460e2c52d67dea14838b03219967cf9cb9 (diff) | |
| download | libgit2-028ef0de72da1ad4d1b2ee4a125ede81e3f2ebed.tar.gz | |
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>
Diffstat (limited to 'src/common.h')
| -rw-r--r-- | src/common.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h index 89b6f61f7..61950787a 100644 --- a/src/common.h +++ b/src/common.h @@ -9,6 +9,7 @@ #include <inttypes.h> #include <assert.h> #include <errno.h> +#include <limits.h> #include <stdlib.h> #include <unistd.h> #include <string.h> @@ -19,6 +20,7 @@ #include "cc-compat.h" #include "util.h" +#include "thread-utils.h" #include "errors.h" #define GIT_PATH_MAX 4096 |
