summaryrefslogtreecommitdiff
path: root/include/my_pthread.h
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-10-19 21:53:14 +0200
committerSergei Golubchik <sergii@pisem.net>2011-10-19 21:53:14 +0200
commit86a2d707794b075701f3ac5e565fc5c7e7fccfe2 (patch)
tree3538a24ed306fc91ed1b1d0b5af8e1ba8b8dfc90 /include/my_pthread.h
parent957b559039ac6ab6d2af08dd271f789f6207a0b5 (diff)
downloadmariadb-git-86a2d707794b075701f3ac5e565fc5c7e7fccfe2.tar.gz
safe_mutex deadlock detector post-merge fixes
Diffstat (limited to 'include/my_pthread.h')
-rw-r--r--include/my_pthread.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 40b939f8fc7..9f851db4209 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -512,11 +512,13 @@ void safe_mutex_free_deadlock_data(safe_mutex_t *mp);
#define safe_mutex_assert_not_owner(mp) \
DBUG_ASSERT(! (mp)->count || \
! pthread_equal(pthread_self(), (mp)->thread))
+#define safe_mutex_setflags(mp, F) do { (mp)->create_flags|= (F); } while (0)
#else
#define my_pthread_mutex_init(A,B,C,D) pthread_mutex_init((A),(B))
#define safe_mutex_assert_owner(mp) do {} while(0)
#define safe_mutex_assert_not_owner(mp) do {} while(0)
#define safe_mutex_free_deadlock_data(mp) do {} while(0)
+#define safe_mutex_setflags(mp, F) do {} while (0)
#endif /* SAFE_MUTEX */
#if defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX)
@@ -920,6 +922,16 @@ extern uint thd_lib_detected;
#define status_var_add(V,C) (V)+=(C)
#define status_var_sub(V,C) (V)-=(C)
+#ifdef SAFE_MUTEX
+#define mysql_mutex_record_order(A,B) \
+ do { \
+ mysql_mutex_lock(A); mysql_mutex_lock(B); \
+ mysql_mutex_unlock(B); mysql_mutex_unlock(A); \
+ } while(0)
+#else
+#define mysql_mutex_record_order(A,B) do { } while(0)
+#endif
+
#ifdef __cplusplus
}
#endif