mirror of
https://github.com/MariaDB/server.git
synced 2026-05-10 17:14:30 +02:00
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.
This commit is contained in:
parent
7f7c311b73
commit
1efa7ea50f
3 changed files with 10 additions and 8 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue