summaryrefslogtreecommitdiff
path: root/mysys/my_thr_init.c
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-04-29 12:24:14 +0300
committerunknown <monty@hundin.mysql.fi>2002-04-29 12:24:14 +0300
commit4c76a1c8961457d428e0f1734a9f239de1827260 (patch)
tree5622a481c28e42581626ad05e58e4afaab88bd0f /mysys/my_thr_init.c
parent2ddd3d219d2cc797b236faaab95449905b4402b2 (diff)
downloadmariadb-git-4c76a1c8961457d428e0f1734a9f239de1827260.tar.gz
Fixed that enable-reads-from-master and repl-parse-query works in option files.
Fixed slowdown problem on win98 Fixed syntax for ALTER TABLE .. RENAME Docs/manual.texi: changelog libmysql/libmysql.c: Fixed that enable-reads-from-master and repl-parse-query works in option files. myisam/ft_boolean_search.c: Portability fixes mysys/my_thr_init.c: cleanup sql/sql_base.cc: Fixed slowdown problem on win98 sql/sql_delete.cc: Removed compiler warnings sql/sql_insert.cc: Removed compiler warnings sql/sql_update.cc: Removed compiler warnings sql/sql_yacc.yy: Fixed syntax for ALTER TABLE .. RENAME vio/vio.c: Added test of OS2 vio/viosocket.c: cleanup
Diffstat (limited to 'mysys/my_thr_init.c')
-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)