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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user