summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorArnaud VERSINI <arnaud.versini@libreoffice.org>2022-08-15 16:54:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-08-16 09:25:31 +0200
commit3329bfe698ecb65cbfbe2bf8f38fce45809fd436 (patch)
tree49af25ba20f11b2377e013c5a78a11f50ad8da54 /sal
parenta20fa9bbbfb3fab623480f95975f30c3904af055 (diff)
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.grandin@collabora.co.uk>
Diffstat (limited to 'sal')
-rw-r--r--sal/rtl/uuid.cxx6
1 files 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 <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();