Commit 2e8b78f7 authored by unknown's avatar unknown

DBUG_ASSERT_LOCK


include/my_sys.h:
  added DBUG_ASSERT_LOCK()
sql/slave.cc:
  use DBUG_ASSERT_LOCK()
parent 7c5c7103
......@@ -725,6 +725,12 @@ 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);
......
......@@ -361,7 +361,7 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock,
abstime.tv_sec=tv.tv_sec+2;
abstime.tv_nsec=tv.tv_usec*1000;
#endif
DBUG_ASSERT(cond_lock->count > 0 && cond_lock->thread == pthread_self());
DBUG_ASSERT_LOCK(cond_lock);
pthread_cond_timedwait(term_cond, cond_lock, &abstime);
if (*slave_running)
KICK_SLAVE(thd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment