sal/rtl/uuid.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 3329bfe698ecb65cbfbe2bf8f38fce45809fd436
Author:     Arnaud VERSINI <arnaud.vers...@libreoffice.org>
AuthorDate: Mon Aug 15 16:54:24 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Aug 16 09:25:31 2022 +0200

    rtl : use a local std::mutex instead of the global mutex
    
    Change-Id: I95a35fe451e459276dcb8c9b90d515d0a34fe36c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138318
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sal/rtl/uuid.cxx b/sal/rtl/uuid.cxx
index 130be12456d6..5d348cb8f8e7 100644
--- a/sal/rtl/uuid.cxx
+++ b/sal/rtl/uuid.cxx
@@ -17,10 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <mutex>
 #include <string.h>
 #include <stdlib.h>
 
-#include <osl/mutex.hxx>
 #include <rtl/random.h>
 #include <rtl/uuid.h>
 #include <rtl/digest.h>
@@ -108,7 +108,9 @@ extern "C" void SAL_CALL rtl_createUuid(sal_uInt8 
*pTargetUUID ,
             return aPool;
         }();
 
-        osl::MutexGuard g(osl::Mutex::getGlobalMutex());
+        static std::mutex aMutex;
+
+        std::scoped_lock g(aMutex);
         if (rtl_random_getBytes(pool, pTargetUUID, 16) != rtl_Random_E_None)
         {
             abort();

Reply via email to