diff options
Diffstat (limited to 'sal/osl/unx/process_impl.cxx')
-rw-r--r-- | sal/osl/unx/process_impl.cxx | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx index 6b34f532e..b7ce28f74 100644 --- a/sal/osl/unx/process_impl.cxx +++ b/sal/osl/unx/process_impl.cxx @@ -483,17 +483,20 @@ extern "C" int _imp_setProcessLocale( rtl_Locale * ); *********************************************/ oslProcessError SAL_CALL osl_getProcessLocale( rtl_Locale ** ppLocale ) { + oslProcessError result = osl_Process_E_Unknown; OSL_PRECOND(ppLocale, "osl_getProcessLocale(): Invalid parameter."); + if (ppLocale) + { + pthread_mutex_lock(&(g_process_locale.m_mutex)); - pthread_mutex_lock(&(g_process_locale.m_mutex)); - - if (g_process_locale.m_pLocale == 0) - _imp_getProcessLocale (&(g_process_locale.m_pLocale)); - *ppLocale = g_process_locale.m_pLocale; - - pthread_mutex_unlock (&(g_process_locale.m_mutex)); + if (g_process_locale.m_pLocale == 0) + _imp_getProcessLocale (&(g_process_locale.m_pLocale)); + *ppLocale = g_process_locale.m_pLocale; + result = osl_Process_E_None; - return (osl_Process_E_None); + pthread_mutex_unlock (&(g_process_locale.m_mutex)); + } + return (result); } /********************************************** |