From 431234a3d6c39f41c75ba0a26f4d09a854bf8fdf Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 12 Mar 2015 21:14:28 +1100 Subject: [PATCH] Remove option of using precarious intermediate variants of cklocks --- src/libckpool.c | 26 -------------------------- src/libckpool.h | 4 ---- 2 files changed, 30 deletions(-) diff --git a/src/libckpool.c b/src/libckpool.c index 7fc3017b..f20a8803 100644 --- a/src/libckpool.c +++ b/src/libckpool.c @@ -337,25 +337,6 @@ void _ck_rlock(cklock_t *lock, const char *file, const char *func, const int lin _mutex_unlock(&lock->mutex, file, func, line); } -/* Intermediate variant of cklock - behaves as a read lock but can be promoted - * to a write lock or demoted to read lock. */ -void _ck_ilock(cklock_t *lock, const char *file, const char *func, const int line) -{ - _mutex_lock(&lock->mutex, file, func, line); -} - -/* Unlock intermediate variant without changing to read or write version */ -void _ck_uilock(cklock_t *lock, const char *file, const char *func, const int line) -{ - _mutex_unlock(&lock->mutex, file, func, line); -} - -/* Upgrade intermediate variant to a write lock */ -void _ck_ulock(cklock_t *lock, const char *file, const char *func, const int line) -{ - _wr_lock(&lock->rwlock, file, func, line); -} - /* Write lock variant of cklock */ void _ck_wlock(cklock_t *lock, const char *file, const char *func, const int line) { @@ -377,13 +358,6 @@ void _ck_dwilock(cklock_t *lock, const char *file, const char *func, const int l _wr_unlock(&lock->rwlock, file, func, line); } -/* Downgrade intermediate variant to a read lock */ -void _ck_dlock(cklock_t *lock, const char *file, const char *func, const int line) -{ - _rd_lock(&lock->rwlock, file, func, line); - _mutex_unlock(&lock->mutex, file, func, line); -} - void _ck_runlock(cklock_t *lock, const char *file, const char *func, const int line) { _rd_unlock(&lock->rwlock, file, func, line); diff --git a/src/libckpool.h b/src/libckpool.h index 79f0f8fd..28ea14c9 100644 --- a/src/libckpool.h +++ b/src/libckpool.h @@ -166,12 +166,8 @@ static inline void flip_80(void *dest_p, const void *src_p) #define cklock_init(_lock) _cklock_init(_lock, __FILE__, __func__, __LINE__) #define ck_rlock(_lock) _ck_rlock(_lock, __FILE__, __func__, __LINE__) -#define ck_ilock(_lock) _ck_ilock(_lock, __FILE__, __func__, __LINE__) -#define ck_uilock(_lock) _ck_uilock(_lock, __FILE__, __func__, __LINE__) -#define ck_ulock(_lock) _ck_ulock(_lock, __FILE__, __func__, __LINE__) #define ck_wlock(_lock) _ck_wlock(_lock, __FILE__, __func__, __LINE__) #define ck_dwlock(_lock) _ck_dwlock(_lock, __FILE__, __func__, __LINE__) -#define ck_dwilock(_lock) _ck_dwilock(_lock, __FILE__, __func__, __LINE__) #define ck_dlock(_lock) _ck_dlock(_lock, __FILE__, __func__, __LINE__) #define ck_runlock(_lock) _ck_runlock(_lock, __FILE__, __func__, __LINE__) #define ck_wunlock(_lock) _ck_wunlock(_lock, __FILE__, __func__, __LINE__)