From feee86495003fcb29ca72a460c36db7b1fd8e6ae Mon Sep 17 00:00:00 2001 From: Alex Fabijanic Date: Mon, 23 Jan 2023 08:06:55 +0100 Subject: [PATCH] fix(TZInfo): Static FastMutex fails to lock when issued from another thread on linux #3918 --- Foundation/src/Timezone_UNIX.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Foundation/src/Timezone_UNIX.cpp b/Foundation/src/Timezone_UNIX.cpp index 83623c3e6..bf3c47483 100644 --- a/Foundation/src/Timezone_UNIX.cpp +++ b/Foundation/src/Timezone_UNIX.cpp @@ -14,7 +14,7 @@ #include "Poco/Timezone.h" #include "Poco/Exception.h" -#include "Poco/Mutex.h" +#include #include @@ -31,7 +31,7 @@ public: int timeZone() { - Poco::FastMutex::ScopedLock lock(_mutex); + std::lock_guard lock(_mutex); #if defined(__APPLE__) || defined(__FreeBSD__) || defined (__OpenBSD__) || POCO_OS == POCO_OS_ANDROID // no timezone global var std::time_t now = std::time(NULL); @@ -50,14 +50,14 @@ public: const char* name(bool dst) { - Poco::FastMutex::ScopedLock lock(_mutex); + std::lock_guard lock(_mutex); tzset(); return tzname[dst ? 1 : 0]; } private: - Poco::FastMutex _mutex; + std::mutex _mutex; };