Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
216b9cb0
Commit
216b9cb0
authored
Nov 18, 2020
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Lock global locale in _get_current_locale.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
df2b13fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
16 deletions
+19
-16
locale.c
dlls/msvcrt/locale.c
+19
-16
No files found.
dlls/msvcrt/locale.c
View file @
216b9cb0
...
...
@@ -1117,6 +1117,22 @@ void free_mbcinfo(MSVCRT_pthreadmbcinfo mbcinfo)
MSVCRT_free
(
mbcinfo
);
}
/*********************************************************************
* _lock_locales (UCRTBASE.@)
*/
void
CDECL
_lock_locales
(
void
)
{
_mlock
(
_SETLOCALE_LOCK
);
}
/*********************************************************************
* _unlock_locales (UCRTBASE.@)
*/
void
CDECL
_unlock_locales
(
void
)
{
_munlock
(
_SETLOCALE_LOCK
);
}
MSVCRT__locale_t
CDECL
get_current_locale_noalloc
(
MSVCRT__locale_t
locale
)
{
thread_data_t
*
data
=
msvcrt_get_thread_data
();
...
...
@@ -1124,6 +1140,7 @@ MSVCRT__locale_t CDECL get_current_locale_noalloc(MSVCRT__locale_t locale)
if
(
!
data
||
!
data
->
have_locale
)
{
_lock_locales
();
*
locale
=
*
MSVCRT_locale
;
}
else
...
...
@@ -1144,6 +1161,8 @@ MSVCRT__locale_t CDECL get_current_locale_noalloc(MSVCRT__locale_t locale)
if
(
locale
->
locinfo
->
ctype1_refcount
)
InterlockedIncrement
(
locale
->
locinfo
->
ctype1_refcount
);
InterlockedIncrement
(
&
locale
->
locinfo
->
lc_time_curr
->
refcount
);
if
(
locale
->
locinfo
==
MSVCRT_locale
->
locinfo
)
_unlock_locales
();
InterlockedIncrement
(
&
locale
->
mbcinfo
->
refcount
);
return
locale
;
...
...
@@ -1931,22 +1950,6 @@ static MSVCRT_pthreadlocinfo create_locinfo(int category,
}
/*********************************************************************
* _lock_locales (UCRTBASE.@)
*/
void
CDECL
_lock_locales
(
void
)
{
_mlock
(
_SETLOCALE_LOCK
);
}
/*********************************************************************
* _unlock_locales (UCRTBASE.@)
*/
void
CDECL
_unlock_locales
(
void
)
{
_munlock
(
_SETLOCALE_LOCK
);
}
/*********************************************************************
* _create_locale (MSVCRT.@)
*/
MSVCRT__locale_t
CDECL
MSVCRT__create_locale
(
int
category
,
const
char
*
locale
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment