From c71fad9983b4a3c6e0d9e9eca02dadfd923ddbbb Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 23 Jan 2013 16:20:39 +0100 Subject: cleanup: * don't use 'myf flags', when 'my_bool is_thread_specific' is meant * call set_malloc_size_cb() for embedded too * warn in safemalloc if the memory is freed by a wrong thread sql/mysqld.cc: move set_malloc_size_cb() to a function that is also called for embedded sql/mysqld.h: gdb-friendly, one can put breakpoint on a function, but not on a macro sql/sql_class.cc: initialize thread_id earlier --- sql/mysqld.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sql/mysqld.h') diff --git a/sql/mysqld.h b/sql/mysqld.h index e9c4f713182..520fa03bdbf 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -534,7 +534,10 @@ inline THD *_current_thd(void) } #endif #define current_thd _current_thd() -#define set_current_thd(X) my_pthread_setspecific_ptr(THR_THD, (X)) +inline int set_current_thd(THD *thd) +{ + return my_pthread_setspecific_ptr(THR_THD, thd); +} /* @todo remove, make it static in ha_maria.cc -- cgit v1.2.1