[Libreoffice-commits] core.git: 3 commits - include/osl sal/osl

Andrzej Hunt andrzej.hunt at collabora.com
Thu Jul 31 07:01:47 PDT 2014


 include/osl/process.h        |    4 ++++
 sal/osl/unx/process_impl.cxx |    5 ++++-
 sal/osl/w32/process.cxx      |    5 ++++-
 3 files changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 533b9ab6fc425746ce30882b424715c97631d907
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date:   Thu Jul 31 15:37:52 2014 +0200

    osl_areCommandArgsSet: ensure mutexes locked when accessing data.
    
    Change-Id: I6b1f10e74aafc47e5618290d92087563c60e3c49

diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx
index b63f222..c70e111 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 25f4e58..786e299 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;
 }
 
 
commit 41fbe85870d0f83c0f7eb59f6f517500b0323239
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date:   Thu Jul 31 15:34:04 2014 +0200

    Mark osl_areCommandArgsSet as internal only.
    
    Change-Id: Iac97290738088bd1ce7469ffee773994e7653efc

diff --git a/include/osl/process.h b/include/osl/process.h
index 876919a..78a937b 100644
--- a/include/osl/process.h
+++ b/include/osl/process.h
@@ -367,6 +367,9 @@ SAL_DLLPUBLIC oslProcessError SAL_CALL osl_getCommandArg(
         sal_uInt32 nArg, rtl_uString **strCommandArg);
 
 /** Determine whether or not the command args have already been set.
+
+    Deprecated: This function is only for internal use
+
     @return The command args are already set, and may not be set again.
     @since LibreOffice 4.3
 */
commit 7cfd6db1ff785bc86125655102d4b13d0d58f792
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date:   Thu Jul 31 15:32:08 2014 +0200

    Add @since to osl_areCommandArgsSet.
    
    Change-Id: Ib2d033f975a9b5bf7b667fd80e495d8f043faff0

diff --git a/include/osl/process.h b/include/osl/process.h
index 7fb619f..876919a 100644
--- a/include/osl/process.h
+++ b/include/osl/process.h
@@ -368,6 +368,7 @@ SAL_DLLPUBLIC oslProcessError SAL_CALL osl_getCommandArg(
 
 /** Determine whether or not the command args have already been set.
     @return The command args are already set, and may not be set again.
+    @since LibreOffice 4.3
 */
 SAL_DLLPUBLIC int SAL_CALL osl_areCommandArgsSet (void);
 


More information about the Libreoffice-commits mailing list