Commit 0203cf88 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Win32: minor thread-safety fix

parent 738b0607
...@@ -211,7 +211,9 @@ const char *GetFallbackEncoding( void ) ...@@ -211,7 +211,9 @@ const char *GetFallbackEncoding( void )
return FindFallbackEncoding (psz_lang); return FindFallbackEncoding (psz_lang);
#else #else
static char buf[16] = ""; static char buf[16] = "";
static vlc_mutex_t lock = VLC_STATIC_MUTEX;
vlc_mutex_lock (&lock);
if (buf[0] == 0) if (buf[0] == 0)
{ {
int cp = GetACP (); int cp = GetACP ();
...@@ -225,6 +227,7 @@ const char *GetFallbackEncoding( void ) ...@@ -225,6 +227,7 @@ const char *GetFallbackEncoding( void )
snprintf (buf, sizeof (buf), "CP%u", cp); snprintf (buf, sizeof (buf), "CP%u", cp);
} }
} }
vlc_mutex_unlock (&lock);
return buf; return buf;
#endif #endif
} }
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