diff options
author | unknown <bar@mysql.com> | 2004-06-16 19:06:45 +0500 |
---|---|---|
committer | unknown <bar@mysql.com> | 2004-06-16 19:06:45 +0500 |
commit | dbabf9266fd2899cd47005a9f41469e140d92510 (patch) | |
tree | 8d0c8b3c10e2de694fda875e0d8bb9c2a9ffe178 /mysys | |
parent | 299086406b2972da0faa7022227d094686a60079 (diff) | |
download | mariadb-git-dbabf9266fd2899cd47005a9f41469e140d92510.tar.gz |
Critical fixes after review:
- mutex was unlocked before the end of the critical sesion,
- Portability issue: It's better to use (*alloc)(x) instead of alloc(x),
if alloc is a function passed as an argument.
- Use {} around if() block, to avoid possible problems with some Windows compilers.
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/charset.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mysys/charset.c b/mysys/charset.c index 72f102a2296..1388fc40c6d 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -469,7 +469,6 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags) } cs= (cs->state & MY_CS_AVAILABLE) ? cs : NULL; } - pthread_mutex_unlock(&THR_LOCK_charset); if (cs && !(cs->state & MY_CS_READY)) { if ((cs->cset->init && cs->cset->init(cs, cs_alloc)) || @@ -478,6 +477,7 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags) else cs->state|= MY_CS_READY; } + pthread_mutex_unlock(&THR_LOCK_charset); return cs; } |