diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/my_pthread.h | 6 | ||||
-rw-r--r-- | include/my_sys.h | 7 |
2 files changed, 6 insertions, 7 deletions
diff --git a/include/my_pthread.h b/include/my_pthread.h index fda31b9d4f2..7e975a8185d 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -485,6 +485,8 @@ int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp, #define my_rwlock_init(A,B) pthread_mutex_init((A),(B)) #define rw_rdlock(A) pthread_mutex_lock((A)) #define rw_wrlock(A) pthread_mutex_lock((A)) +#define rw_tryrdlock(A) pthread_mutex_trylock((A)) +#define rw_trywrlock(A) pthread_mutex_trylock((A)) #define rw_unlock(A) pthread_mutex_unlock((A)) #define rwlock_destroy(A) pthread_mutex_destroy((A)) #elif defined(HAVE_PTHREAD_RWLOCK_RDLOCK) @@ -492,6 +494,8 @@ int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp, #define my_rwlock_init(A,B) pthread_rwlock_init((A),(B)) #define rw_rdlock(A) pthread_rwlock_rdlock(A) #define rw_wrlock(A) pthread_rwlock_wrlock(A) +#define rw_tryrdlock(A) pthread_mutex_tryrdlock((A)) +#define rw_trywrlock(A) pthread_mutex_trywrlock((A)) #define rw_unlock(A) pthread_rwlock_unlock(A) #define rwlock_destroy(A) pthread_rwlock_destroy(A) #elif defined(HAVE_RWLOCK_INIT) @@ -512,6 +516,8 @@ typedef struct _my_rw_lock_t { #define rw_lock_t my_rw_lock_t #define rw_rdlock(A) my_rw_rdlock((A)) #define rw_wrlock(A) my_rw_wrlock((A)) +#define rw_tryrdlock(A) my_rw_tryrdlock((A)) +#define rw_trywrlock(A) my_rw_trywrlock((A)) #define rw_unlock(A) my_rw_unlock((A)) #define rwlock_destroy(A) my_rwlock_destroy((A)) diff --git a/include/my_sys.h b/include/my_sys.h index 9e64d3159c5..70de1e43a18 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -750,13 +750,6 @@ byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen); ulong checksum(const byte *mem, uint count); uint my_bit_log2(ulong value); -#if defined(SAFE_MUTEX) && !defined(DBUG_OFF) -#define DBUG_ASSERT_LOCK(lock) DBUG_ASSERT((lock)->count == 1 && \ - (lock)->thread == pthread_self()) -#else -#define DBUG_ASSERT_LOCK(lock) -#endif - #if defined(_MSC_VER) && !defined(__WIN__) extern void sleep(int sec); #endif |