From 3329bfe698ecb65cbfbe2bf8f38fce45809fd436 Mon Sep 17 00:00:00 2001 From: Arnaud VERSINI Date: Mon, 15 Aug 2022 16:54:24 +0200 Subject: [PATCH] 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 --- sal/rtl/uuid.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 #include #include -#include #include #include #include @@ -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();