]> git.proxmox.com Git - libgit2.git/blobdiff - src/thread-utils.h
threads: split up OS-dependent rwlock code
[libgit2.git] / src / thread-utils.h
index 1eb51de25d291ae5ab62e9632e0f8e1bab9c1a83..f75e4408769ab2be60e0b2dd6abd7a0f512a866d 100644 (file)
@@ -46,30 +46,6 @@ typedef git_atomic git_atomic_ssize;
 #   include "unix/pthread.h"
 #endif
 
-/* Pthread (-ish) rwlock
- *
- * This differs from normal pthreads rwlocks in two ways:
- * 1. Separate APIs for releasing read locks and write locks (as
- *    opposed to the pure POSIX API which only has one unlock fn)
- * 2. You should not use recursive read locks (i.e. grabbing a read
- *    lock in a thread that already holds a read lock) because the
- *    Windows implementation doesn't support it
- */
-#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_rdunlock(a)
-#define git_rwlock_wrlock(a)   pthread_rwlock_wrlock(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)
 {
 #if defined(GIT_WIN32)