diff options
author | Eugene Kosov <claprix@yandex.ru> | 2020-04-30 20:06:26 +0300 |
---|---|---|
committer | Eugene Kosov <claprix@yandex.ru> | 2020-05-05 18:13:31 +0300 |
commit | 89ff4176c125f5993aba0732e52102227577ed96 (patch) | |
tree | 42980e30d3f4f02b09b0fda80790f7241fd699f4 /include | |
parent | 90aad47dd9f28101b1d2c4a01c2a10db5ad5f426 (diff) | |
download | mariadb-git-89ff4176c125f5993aba0732e52102227577ed96.tar.gz |
MDEV-22437 make THR_THD* variable thread_local
Now all access goes through _current_thd() and set_current_thd()
functions.
Some functions like THD::store_globals() can not fail now.
Diffstat (limited to 'include')
-rw-r--r-- | include/my_pthread.h | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/include/my_pthread.h b/include/my_pthread.h index 0cb830fc9c6..4888bfcc2c8 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -360,22 +360,8 @@ size_t my_setstacksize(pthread_attr_t *attr, size_t stacksize); #ifdef MYSQL_CLIENT #define _current_thd() NULL -#elif defined(_WIN32) -#ifdef __cplusplus -extern "C" -#endif -MYSQL_THD _current_thd_noinline(); -#define _current_thd() _current_thd_noinline() #else -/* - THR_THD is a key which will be used to set/get THD* for a thread, - using my_pthread_setspecific_ptr()/my_thread_getspecific_ptr(). -*/ -extern pthread_key(MYSQL_THD, THR_THD); -static inline MYSQL_THD _current_thd(void) -{ - return my_pthread_getspecific_ptr(MYSQL_THD,THR_THD); -} +MYSQL_THD _current_thd(); #endif /* safe_mutex adds checking to mutex for easier debugging */ |