summaryrefslogtreecommitdiff
path: root/include/my_pthread.h
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-06-29 20:26:33 +0300
committerunknown <monty@hundin.mysql.fi>2002-06-29 20:26:33 +0300
commit10d282f6321cf02b060ed489550b65c35f4bee58 (patch)
tree3f4af5895e26720092bbc9a5f40873681337d97e /include/my_pthread.h
parent6e5952d087b8686242e28850ce958df0b00499d7 (diff)
downloadmariadb-git-10d282f6321cf02b060ed489550b65c35f4bee58.tar.gz
Added support for rw_tryrdlock() and rw_trywrlock()
include/my_sys.h: Removed not needed macro (SAFE_MUTEX can handle this case better). sql/log.cc: Simple optimization sql/log_event.cc: Fix problem in LOAD DATA if table_name is NULL (unlikely event) sql/log_event.h: cleanup sql/slave.cc: remove unnecessary assert
Diffstat (limited to 'include/my_pthread.h')
-rw-r--r--include/my_pthread.h6
1 files changed, 6 insertions, 0 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))