summaryrefslogtreecommitdiff
path: root/mysys/my_thr_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'mysys/my_thr_init.c')
-rw-r--r--mysys/my_thr_init.c21
1 files changed, 0 insertions, 21 deletions
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index 2278c467f32..2c346145cf5 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -23,11 +23,7 @@
#include <signal.h>
#ifdef THREAD
-#ifdef USE_TLS
pthread_key(struct st_my_thread_var*, THR_KEY_mysys);
-#else
-pthread_key(struct st_my_thread_var, THR_KEY_mysys);
-#endif /* USE_TLS */
pthread_mutex_t THR_LOCK_malloc,THR_LOCK_open,
THR_LOCK_lock,THR_LOCK_isam,THR_LOCK_myisam,THR_LOCK_heap,
THR_LOCK_net, THR_LOCK_charset, THR_LOCK_threads, THR_LOCK_time;
@@ -258,7 +254,6 @@ my_bool my_thread_init(void)
(ulong) pthread_self());
#endif
-#if !defined(__WIN__) || defined(USE_TLS)
if (my_pthread_getspecific(struct st_my_thread_var *,THR_KEY_mysys))
{
#ifdef EXTRA_DEBUG_THREADS
@@ -273,15 +268,6 @@ my_bool my_thread_init(void)
goto end;
}
pthread_setspecific(THR_KEY_mysys,tmp);
-
-#else /* defined(__WIN__) && !(defined(USE_TLS) */
- /*
- Skip initialization if the thread specific variable is already initialized
- */
- if (THR_KEY_mysys.id)
- goto end;
- tmp= &THR_KEY_mysys;
-#endif
#if defined(__WIN__) && defined(EMBEDDED_LIBRARY)
tmp->pthread_self= (pthread_t) getpid();
#else
@@ -342,11 +328,7 @@ void my_thread_end(void)
pthread_cond_destroy(&tmp->suspend);
#endif
pthread_mutex_destroy(&tmp->mutex);
-#if !defined(__WIN__) || defined(USE_TLS)
free(tmp);
-#else
- tmp->init= 0;
-#endif
/*
Decrement counter for number of running threads. We are using this
@@ -360,10 +342,7 @@ void my_thread_end(void)
pthread_cond_signal(&THR_COND_threads);
pthread_mutex_unlock(&THR_LOCK_threads);
}
- /* The following free has to be done, even if my_thread_var() is 0 */
-#if !defined(__WIN__) || defined(USE_TLS)
pthread_setspecific(THR_KEY_mysys,0);
-#endif
}
struct st_my_thread_var *_my_thread_var(void)