diff options
author | unknown <monty@donna.mysql.com> | 2000-09-20 19:37:07 +0300 |
---|---|---|
committer | unknown <monty@donna.mysql.com> | 2000-09-20 19:37:07 +0300 |
commit | 91cea52c95180717172d927d3d2393c4d2b789f8 (patch) | |
tree | df5d441bed10a34a5a2157ad96f60a04046960b8 /mysys/my_thr_init.c | |
parent | fa0f0e04bc2c736eba17082352b7cec6ffcbe9a4 (diff) | |
download | mariadb-git-91cea52c95180717172d927d3d2393c4d2b789f8.tar.gz |
Fix for SAFE_MUTEX on windows
Docs/manual.texi:
cleanup
include/my_pthread.h:
Fix for SAFEMUTEX under windows
mysys/my_thr_init.c:
Fix for SAFEMUTEX under windows
mysys/my_winthread.c:
Fix for SAFEMUTEX under windows
mysys/thr_mutex.c:
Fix for SAFEMUTEX under windows
sql/mysqld.cc:
Remove unused code
sql/sql_table.cc:
Fix filename comparison on Windows
support-files/Makefile.am:
Added magic file
Diffstat (limited to 'mysys/my_thr_init.c')
-rw-r--r-- | mysys/my_thr_init.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c index d879da8e65d..6b75444f3fc 100644 --- a/mysys/my_thr_init.c +++ b/mysys/my_thr_init.c @@ -77,10 +77,19 @@ void my_thread_global_end(void) static long thread_id=0; +/* + We can't use mutex_locks here if we re using windows as + we may have compiled the program with SAFE_MUTEX, in which + case the checking of mutex_locks will not work until + the pthread_self thread specific variable is initialized. +*/ + my_bool my_thread_init(void) { struct st_my_thread_var *tmp; +#if !defined(__WIN__) || defined(USE_TLS) || ! defined(SAFE_MUTEX) pthread_mutex_lock(&THR_LOCK_lock); +#endif #if !defined(__WIN__) || defined(USE_TLS) if (my_pthread_getspecific(struct st_my_thread_var *,THR_KEY_mysys)) { @@ -98,9 +107,11 @@ my_bool my_thread_init(void) pthread_setspecific(THR_KEY_mysys,tmp); #else - if (THR_KEY_mysys.id) /* Allready initialized */ + if (THR_KEY_mysys.id) /* Already initialized */ { +#if !defined(__WIN__) || defined(USE_TLS) || ! defined(SAFE_MUTEX) pthread_mutex_unlock(&THR_LOCK_lock); +#endif return 0; } tmp= &THR_KEY_mysys; @@ -108,7 +119,9 @@ my_bool my_thread_init(void) tmp->id= ++thread_id; pthread_mutex_init(&tmp->mutex,NULL); pthread_cond_init(&tmp->suspend, NULL); +#if !defined(__WIN__) || defined(USE_TLS) || ! defined(SAFE_MUTEX) pthread_mutex_unlock(&THR_LOCK_lock); +#endif return 0; } |