diff options
author | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-07-31 15:37:52 +0200 |
---|---|---|
committer | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-07-31 16:02:09 +0200 |
commit | 533b9ab6fc425746ce30882b424715c97631d907 (patch) | |
tree | 27b68856d57e4090fb9306397309546f4a40f719 /sal | |
parent | 41fbe85870d0f83c0f7eb59f6f517500b0323239 (diff) |
osl_areCommandArgsSet: ensure mutexes locked when accessing data.
Change-Id: I6b1f10e74aafc47e5618290d92087563c60e3c49
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/process_impl.cxx | 5 | ||||
-rw-r--r-- | sal/osl/w32/process.cxx | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx index b63f222ec15f..c70e11141e74 100644 --- a/sal/osl/unx/process_impl.cxx +++ b/sal/osl/unx/process_impl.cxx @@ -193,7 +193,10 @@ oslProcessError SAL_CALL osl_getCommandArg (sal_uInt32 nArg, rtl_uString ** strC int SAL_CALL osl_areCommandArgsSet (void) { - return (g_command_args.m_nCount > 0); + pthread_mutex_lock (&(g_command_args.m_mutex)); + int nRet = (int) (g_command_args.m_nCount > 0); + pthread_mutex_unlock (&(g_command_args.m_mutex)); + return nRet; } /*************************************** diff --git a/sal/osl/w32/process.cxx b/sal/osl/w32/process.cxx index 25f4e58be7e4..786e299811b7 100644 --- a/sal/osl/w32/process.cxx +++ b/sal/osl/w32/process.cxx @@ -376,7 +376,10 @@ oslProcessError SAL_CALL osl_getCommandArg( sal_uInt32 nArg, rtl_uString **strCo int SAL_CALL osl_areCommandArgsSet(void) { - return (g_command_args.m_nCount > 0); + osl_acquireMutex (*osl_getGlobalMutex()); + int nRet = (int) (g_command_args.m_nCount > 0); + osl_releaseMutex (*osl_getGlobalMutex()); + return nRet; } |