summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-04-29 12:25:35 +0300
committerunknown <monty@hundin.mysql.fi>2002-04-29 12:25:35 +0300
commitff3029502ba7b5527055a8464f7afc710dd8c6a9 (patch)
treea7119b6045f75031f59a71356cf9c1c362f65724 /mysys
parent1450d3e0ab6cdfdefcefd6e5de3798da694fcc29 (diff)
parent4c76a1c8961457d428e0f1734a9f239de1827260 (diff)
downloadmariadb-git-ff3029502ba7b5527055a8464f7afc710dd8c6a9.tar.gz
Merge work:/home/bk/mysql-4.0 into hundin.mysql.fi:/my/bk/mysql-4.0
Docs/manual.texi: Auto merged
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_thr_init.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index 0bd542d2bd9..8e6fdbbbec5 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -105,6 +105,8 @@ static long thread_id=0;
my_bool my_thread_init(void)
{
struct st_my_thread_var *tmp;
+ my_bool error=0;
+
#ifdef EXTRA_DEBUG_THREADS
fprintf(stderr,"my_thread_init(): thread_id=%ld\n",pthread_self());
#endif
@@ -117,16 +119,14 @@ my_bool my_thread_init(void)
{
#ifdef EXTRA_DEBUG
fprintf(stderr,"my_thread_init() called more than once in thread %ld\n",
- pthread_self());
+ pthread_self());
#endif
- pthread_mutex_unlock(&THR_LOCK_lock);
- return 0; /* Safequard */
+ goto end;
}
- if (!(tmp=(struct st_my_thread_var *)
- calloc(1, sizeof(struct st_my_thread_var))))
+ if (!(tmp= (struct st_my_thread_var *) calloc(1, sizeof(*tmp))))
{
- pthread_mutex_unlock(&THR_LOCK_lock);
- return 1;
+ error= 1;
+ goto end;
}
pthread_setspecific(THR_KEY_mysys,tmp);
@@ -146,7 +146,7 @@ end:
#if !defined(__WIN__) || defined(USE_TLS) || ! defined(SAFE_MUTEX)
pthread_mutex_unlock(&THR_LOCK_lock);
#endif
- return 0;
+ return error;
}
void my_thread_end(void)