Commit 1edd0f4d authored by Alexandre Julliard's avatar Alexandre Julliard

msvcrt: Get rid of the LOCK_LOCALE macros.

parent c044cf41
...@@ -49,10 +49,6 @@ LCID MSVCRT___lc_handle[MSVCRT_LC_MAX - MSVCRT_LC_MIN + 1] = { 0 }; ...@@ -49,10 +49,6 @@ LCID MSVCRT___lc_handle[MSVCRT_LC_MAX - MSVCRT_LC_MIN + 1] = { 0 };
int MSVCRT___mb_cur_max = 1; int MSVCRT___mb_cur_max = 1;
static unsigned char charmax = CHAR_MAX; static unsigned char charmax = CHAR_MAX;
/* MT */
#define LOCK_LOCALE _mlock(_SETLOCALE_LOCK);
#define UNLOCK_LOCALE _munlock(_SETLOCALE_LOCK);
#define MSVCRT_LEADBYTE 0x8000 #define MSVCRT_LEADBYTE 0x8000
#define MSVCRT_C1_DEFINED 0x200 #define MSVCRT_C1_DEFINED 0x200
...@@ -1596,7 +1592,7 @@ static MSVCRT_pthreadlocinfo create_locinfo(int category, ...@@ -1596,7 +1592,7 @@ static MSVCRT_pthreadlocinfo create_locinfo(int category,
*/ */
void CDECL _lock_locales(void) void CDECL _lock_locales(void)
{ {
LOCK_LOCALE _mlock(_SETLOCALE_LOCK);
} }
/********************************************************************* /*********************************************************************
...@@ -1604,7 +1600,7 @@ void CDECL _lock_locales(void) ...@@ -1604,7 +1600,7 @@ void CDECL _lock_locales(void)
*/ */
void CDECL _unlock_locales(void) void CDECL _unlock_locales(void)
{ {
UNLOCK_LOCALE _munlock(_SETLOCALE_LOCK);
} }
/********************************************************************* /*********************************************************************
...@@ -1661,7 +1657,7 @@ char* CDECL MSVCRT_setlocale(int category, const char* locale) ...@@ -1661,7 +1657,7 @@ char* CDECL MSVCRT_setlocale(int category, const char* locale)
return NULL; return NULL;
} }
LOCK_LOCALE; _lock_locales();
if(locinfo->lc_handle[MSVCRT_LC_COLLATE]!=newlocinfo->lc_handle[MSVCRT_LC_COLLATE] if(locinfo->lc_handle[MSVCRT_LC_COLLATE]!=newlocinfo->lc_handle[MSVCRT_LC_COLLATE]
|| locinfo->lc_id[MSVCRT_LC_COLLATE].wCodePage!=newlocinfo->lc_id[MSVCRT_LC_COLLATE].wCodePage) { || locinfo->lc_id[MSVCRT_LC_COLLATE].wCodePage!=newlocinfo->lc_id[MSVCRT_LC_COLLATE].wCodePage) {
...@@ -1816,7 +1812,7 @@ char* CDECL MSVCRT_setlocale(int category, const char* locale) ...@@ -1816,7 +1812,7 @@ char* CDECL MSVCRT_setlocale(int category, const char* locale)
} }
free_locinfo(newlocinfo); free_locinfo(newlocinfo);
UNLOCK_LOCALE; _unlock_locales();
if(locinfo == MSVCRT_locale->locinfo) { if(locinfo == MSVCRT_locale->locinfo) {
int i; int i;
...@@ -1858,14 +1854,14 @@ MSVCRT_wchar_t* CDECL MSVCRT__wsetlocale(int category, const MSVCRT_wchar_t* wlo ...@@ -1858,14 +1854,14 @@ MSVCRT_wchar_t* CDECL MSVCRT__wsetlocale(int category, const MSVCRT_wchar_t* wlo
MSVCRT_wcstombs(locale, wlocale, len); MSVCRT_wcstombs(locale, wlocale, len);
} }
LOCK_LOCALE; _lock_locales();
ret = MSVCRT_setlocale(category, locale); ret = MSVCRT_setlocale(category, locale);
MSVCRT_free(locale); MSVCRT_free(locale);
if(ret && MSVCRT_mbstowcs(current_lc_all, ret, MAX_LOCALE_LENGTH)==-1) if(ret && MSVCRT_mbstowcs(current_lc_all, ret, MAX_LOCALE_LENGTH)==-1)
ret = NULL; ret = NULL;
UNLOCK_LOCALE; _unlock_locales();
return ret ? current_lc_all : NULL; return ret ? current_lc_all : NULL;
} }
...@@ -1921,9 +1917,9 @@ BOOL msvcrt_init_locale(void) ...@@ -1921,9 +1917,9 @@ BOOL msvcrt_init_locale(void)
{ {
int i; int i;
LOCK_LOCALE; _lock_locales();
MSVCRT_locale = MSVCRT__create_locale(0, "C"); MSVCRT_locale = MSVCRT__create_locale(0, "C");
UNLOCK_LOCALE; _unlock_locales();
if(!MSVCRT_locale) if(!MSVCRT_locale)
return FALSE; return FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment