summaryrefslogtreecommitdiff
path: root/src/thread-utils.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-08-22 14:10:56 -0700
committerRussell Belfer <rb@github.com>2013-08-22 14:10:56 -0700
commit972bb689c4a69ba5a5dfaeebacc7198622c4f051 (patch)
tree563f1ac8a33f5d44f32be76ea5d7fc862cec8457 /src/thread-utils.h
parent2b6e1908476c95c84d3e3a62ac069f789156b070 (diff)
downloadlibgit2-972bb689c4a69ba5a5dfaeebacc7198622c4f051.tar.gz
Add SRWLock implementation of rwlocks for Win32
Diffstat (limited to 'src/thread-utils.h')
-rw-r--r--src/thread-utils.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/thread-utils.h b/src/thread-utils.h
index ffcdb4ab0..819e24e7b 100644
--- a/src/thread-utils.h
+++ b/src/thread-utils.h
@@ -66,12 +66,17 @@ typedef git_atomic git_atomic_ssize;
#define git_rwlock pthread_rwlock_t
#define git_rwlock_init(a) pthread_rwlock_init(a, NULL)
#define git_rwlock_rdlock(a) pthread_rwlock_rdlock(a)
-#define git_rwlock_rdunlock(a) pthread_rwlock_unlock(a)
+#define git_rwlock_rdunlock(a) pthread_rwlock_rdunlock(a)
#define git_rwlock_wrlock(a) pthread_rwlock_wrlock(a)
-#define git_rwlock_wrunlock(a) pthread_rwlock_unlock(a)
+#define git_rwlock_wrunlock(a) pthread_rwlock_wrunlock(a)
#define git_rwlock_free(a) pthread_rwlock_destroy(a)
#define GIT_RWLOCK_STATIC_INIT PTHREAD_RWLOCK_INITIALIZER
+#ifndef GIT_WIN32
+#define pthread_rwlock_rdunlock pthread_rwlock_unlock
+#define pthread_rwlock_wrunlock pthread_rwlock_unlock
+#endif
+
GIT_INLINE(void) git_atomic_set(git_atomic *a, int val)
{