58 UNIV_INTERN mysql_pfs_key_t thr_local_mutex_key;
77 #define THR_LOCAL_MAGIC_N 1231234
91 || local->
slot_no < OS_THREAD_MAX_N);
109 ut_ad(thr_local_hash);
110 ut_ad(mutex_own(&thr_local_mutex));
120 mutex_exit(&thr_local_mutex);
124 mutex_enter(&thr_local_mutex);
129 ut_ad(thr_local_validate(local));
146 mutex_enter(&thr_local_mutex);
148 local = thr_local_get(
id);
152 mutex_exit(&thr_local_mutex);
168 mutex_enter(&thr_local_mutex);
170 local = thr_local_get(
id);
174 mutex_exit(&thr_local_mutex);
188 mutex_enter(&thr_local_mutex);
192 mutex_exit(&thr_local_mutex);
206 if (thr_local_hash == NULL) {
214 local->
magic_n = THR_LOCAL_MAGIC_N;
215 local->
slot_no = ULINT_UNDEFINED;
218 mutex_enter(&thr_local_mutex);
224 mutex_exit(&thr_local_mutex);
237 mutex_enter(&thr_local_mutex);
245 mutex_exit(&thr_local_mutex);
253 mutex_exit(&thr_local_mutex);
256 ut_ad(thr_local_validate(local));
269 ut_a(thr_local_hash == NULL);
271 thr_local_hash = hash_create(OS_THREAD_MAX_N + 100);
273 mutex_create(thr_local_mutex_key,
274 &thr_local_mutex, SYNC_THR_LOCAL);
286 ut_a(thr_local_hash != NULL);
300 ut_ad(thr_local_validate(prev_local));
305 hash_table_free(thr_local_hash);
306 thr_local_hash = NULL;