From 517ef2bd39a0d89fc4a99201d5f97ceea1766397 Mon Sep 17 00:00:00 2001 From: Monty Date: Sun, 26 Jul 2015 14:31:22 +0300 Subject: Added easy way to assert if another thread has died. Added some extra safety asserts in MyISAM key cache. my_thread_var->init is now: 0 at startup 1 at init 2 when thread dies --- mysys/my_thr_init.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mysys/my_thr_init.c') diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c index d9dbacc8524..1e4b85583b1 100644 --- a/mysys/my_thr_init.c +++ b/mysys/my_thr_init.c @@ -372,6 +372,8 @@ void my_thread_end(void) mysql_cond_signal(&THR_COND_threads); mysql_mutex_unlock(&THR_LOCK_threads); + /* Trash variable so that we can detect false accesses to my_thread_var */ + tmp->init= 2; TRASH(tmp, sizeof(*tmp)); free(tmp); } -- cgit v1.2.1