1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

DBUG_ASSERT_LOCK

This commit is contained in:
sasha@mysql.sashanet.com
2002-03-08 09:26:56 -07:00
parent 7779e2cbe6
commit 28848fa93b
2 changed files with 7 additions and 1 deletions

View File

@@ -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);

View File

@@ -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);