summaryrefslogtreecommitdiff
path: root/include/my_pthread.h
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2012-08-01 17:27:34 +0300
committerMichael Widenius <monty@askmonty.org>2012-08-01 17:27:34 +0300
commit1d0f70c2f894b27e98773a282871d32802f67964 (patch)
tree833e683e0ced29c4323c29a9d845703d4dfcd81b /include/my_pthread.h
parent5a86a61219826aadf8d08cbc447fe438f2bf50c3 (diff)
downloadmariadb-git-1d0f70c2f894b27e98773a282871d32802f67964.tar.gz
Temporary commit of merge of MariaDB 10.0-base and MySQL 5.6
Diffstat (limited to 'include/my_pthread.h')
-rw-r--r--include/my_pthread.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 21c85c633d6..4f484265583 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -498,13 +498,22 @@ void safe_mutex_free_deadlock_data(safe_mutex_t *mp);
DBUG_ASSERT(! (mp)->count || \
! pthread_equal(pthread_self(), (mp)->thread))
#define safe_mutex_setflags(mp, F) do { (mp)->create_flags|= (F); } while (0)
+#define my_cond_timedwait(A,B,C) safe_cond_timedwait((A),(B),(C),__FILE__,__LINE__)
+#define my_cond_wait(A,B) safe_cond_wait((A), (B), __FILE__, __LINE__)
#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_assert_owner(mp) do {} while (0)
+#define safe_mutex_assert_not_owner(mp) do {} while (0)
#define safe_mutex_setflags(mp, F) do {} while (0)
-#endif /* SAFE_MUTEX */
+
+#if defined(MY_PTHREAD_FASTMUTEX)
+#define my_cond_timedwait(A,B,C) pthread_cond_timedwait((A), &(B)->mutex, (C))
+#define my_cond_wait(A,B) pthread_cond_wait((A), &(B)->mutex)
+#else
+#define my_cond_timedwait(A,B,C) pthread_cond_timedwait((A),(B),(C))
+#define my_cond_wait(A,B) pthread_cond_wait((A), (B))
+#endif /* MY_PTHREAD_FASTMUTEX */
+#endif /* !SAFE_MUTEX */
#if defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX)
typedef struct st_my_pthread_fastmutex_t