From e3677453ce55634184a16f5f34d9d56090f7d4bb Mon Sep 17 00:00:00 2001 From: Raul Gomez Rodriguez Date: Fri, 20 Mar 2026 13:33:11 -0700 Subject: [PATCH 1/4] DefaultUnnamedMutex migration --- Include/httpClient/pal.h | 19 +++++++++++++++++++ Source/Global/NetworkState.h | 2 +- Source/Global/global.cpp | 4 ++-- Source/Task/AsyncLib.cpp | 2 +- Source/Task/AtomicVector.h | 2 +- Source/Task/TaskQueueImpl.h | 10 +++++----- Source/Task/ThreadPool_stl.cpp | 4 ++-- Source/Task/WaitTimer_stl.cpp | 4 ++-- Source/WebSocket/hcwebsocket.h | 2 +- 9 files changed, 34 insertions(+), 15 deletions(-) diff --git a/Include/httpClient/pal.h b/Include/httpClient/pal.h index af94bd935..bf24550b8 100644 --- a/Include/httpClient/pal.h +++ b/Include/httpClient/pal.h @@ -13,6 +13,7 @@ #include #include #include +#include #include @@ -494,3 +495,21 @@ enum class HCWebSocketCloseStatus : uint32_t }; } + +// Sony PS5 STL library defect: std::mutex without a name parameter creates named mutexes, +// which have a low limit. Use DefaultUnnamedMutex as a workaround so that mutexes are unnamed +// by default. +class DefaultUnnamedMutex : public std::mutex +{ +public: +#if __PROSPERO__ + DefaultUnnamedMutex() noexcept : std::mutex(nullptr) {} + ~DefaultUnnamedMutex() noexcept = default; + DefaultUnnamedMutex(DefaultUnnamedMutex const&) = delete; + DefaultUnnamedMutex& operator=(DefaultUnnamedMutex const&) = delete; + void lock() { std::mutex::lock(); } + bool try_lock() { return std::mutex::try_lock(); } + void unlock() { std::mutex::unlock(); } + native_handle_type native_handle() { return std::mutex::native_handle(); } +#endif +}; diff --git a/Source/Global/NetworkState.h b/Source/Global/NetworkState.h index bfd5364b3..66b1abfae 100644 --- a/Source/Global/NetworkState.h +++ b/Source/Global/NetworkState.h @@ -76,7 +76,7 @@ class NetworkState static void CALLBACK HttpProviderCleanupComplete(XAsyncBlock* async); bool ScheduleCleanup(); - std::mutex m_mutex; + DefaultUnnamedMutex m_mutex; UniquePtr m_httpProvider; diff --git a/Source/Global/global.cpp b/Source/Global/global.cpp index 63c0375a7..2b3e84b8e 100644 --- a/Source/Global/global.cpp +++ b/Source/Global/global.cpp @@ -25,11 +25,11 @@ HRESULT http_singleton::singleton_access( _Out_ std::shared_ptr& singleton ) noexcept { - static std::mutex s_mutex; + static DefaultUnnamedMutex s_mutex; static std::shared_ptr s_singleton{ nullptr }; static uint8_t s_useCount{ 0 }; - std::lock_guard lock{ s_mutex }; + std::lock_guard lock{ s_mutex }; switch (mode) { case singleton_access_mode::create: diff --git a/Source/Task/AsyncLib.cpp b/Source/Task/AsyncLib.cpp index 17d5389d0..023d07a82 100644 --- a/Source/Task/AsyncLib.cpp +++ b/Source/Task/AsyncLib.cpp @@ -45,7 +45,7 @@ struct AsyncState XAsyncBlock providerAsyncBlock { }; XAsyncBlock* userAsyncBlock = nullptr; XTaskQueueHandle queue = nullptr; - std::mutex waitMutex; + DefaultUnnamedMutex waitMutex; std::condition_variable waitCondition; bool waitSatisfied = false; diff --git a/Source/Task/AtomicVector.h b/Source/Task/AtomicVector.h index 5a2a0f20e..3227ff755 100644 --- a/Source/Task/AtomicVector.h +++ b/Source/Task/AtomicVector.h @@ -94,7 +94,7 @@ class AtomicVector private: - std::mutex m_lock; + DefaultUnnamedMutex m_lock; std::vector m_buffers[2]; std::atomic m_indexAndRef { 0 }; }; diff --git a/Source/Task/TaskQueueImpl.h b/Source/Task/TaskQueueImpl.h index 6525d66f2..7e4bfa5bf 100644 --- a/Source/Task/TaskQueueImpl.h +++ b/Source/Task/TaskQueueImpl.h @@ -114,7 +114,7 @@ class SubmitCallback }; std::atomic m_nextToken{ 0 }; - std::mutex m_lock; + DefaultUnnamedMutex m_lock; CallbackRegistration m_buffer1[SUBMIT_CALLBACK_MAX]; CallbackRegistration m_buffer2[SUBMIT_CALLBACK_MAX]; CallbackRegistration* m_buffers[2]= { m_buffer1, m_buffer2 }; @@ -149,7 +149,7 @@ class QueueWaitRegistry std::atomic m_nextToken{ 0 }; StaticArray m_callbacks; - std::mutex m_lock; + DefaultUnnamedMutex m_lock; }; class TaskQueuePortImpl: public Api @@ -257,12 +257,12 @@ class TaskQueuePortImpl: public Api std::atomic m_processingSerializedTbCallback{ 0 }; std::atomic m_processingCallback{ 0 }; std::condition_variable m_processingCallbackCv; - std::mutex m_lock; + DefaultUnnamedMutex m_lock; std::unique_ptr> m_queueList; std::unique_ptr> m_pendingList; std::unique_ptr> m_terminationList; std::unique_ptr> m_pendingTerminationList; - std::mutex m_terminationLock; + DefaultUnnamedMutex m_terminationLock; OS::WaitTimer m_timer; OS::ThreadPool m_threadPool; std::atomic m_timerDue = { UINT64_MAX }; @@ -465,7 +465,7 @@ class TaskQueueImpl : public Api struct TerminationData { bool terminated; - std::mutex lock; + DefaultUnnamedMutex lock; std::condition_variable cv; }; diff --git a/Source/Task/ThreadPool_stl.cpp b/Source/Task/ThreadPool_stl.cpp index dc7443bf0..a429e3e9a 100644 --- a/Source/Task/ThreadPool_stl.cpp +++ b/Source/Task/ThreadPool_stl.cpp @@ -220,12 +220,12 @@ namespace OS std::atomic m_refs{ 1 }; - std::mutex m_wakeLock; + DefaultUnnamedMutex m_wakeLock; std::condition_variable m_wake; uint32_t m_calls{ 0 }; bool m_terminate{ false }; - std::mutex m_activeLock; + DefaultUnnamedMutex m_activeLock; std::condition_variable m_active; uint32_t m_activeCalls{ 0 }; diff --git a/Source/Task/WaitTimer_stl.cpp b/Source/Task/WaitTimer_stl.cpp index 5f87d2563..f4e098c7c 100644 --- a/Source/Task/WaitTimer_stl.cpp +++ b/Source/Task/WaitTimer_stl.cpp @@ -53,7 +53,7 @@ namespace OS TimerEntry const& Peek() const noexcept; TimerEntry Pop() noexcept; - std::mutex m_mutex; + DefaultUnnamedMutex m_mutex; std::condition_variable m_cv; std::vector m_queue; // used as a heap std::thread m_t; @@ -64,7 +64,7 @@ namespace OS namespace { std::shared_ptr g_timerQueue; - std::mutex g_timerQueueMutex; + DefaultUnnamedMutex g_timerQueueMutex; } TimerQueue::~TimerQueue() diff --git a/Source/WebSocket/hcwebsocket.h b/Source/WebSocket/hcwebsocket.h index de1249b67..daee11c0c 100644 --- a/Source/WebSocket/hcwebsocket.h +++ b/Source/WebSocket/hcwebsocket.h @@ -181,7 +181,7 @@ class WebSocket : public std::enable_shared_from_this void* context{ nullptr }; }; - std::mutex m_stateMutex; + DefaultUnnamedMutex m_stateMutex; enum class State { Initial, From 3e273d350685125f02fee7106d36ab82d3fa82f2 Mon Sep 17 00:00:00 2001 From: Raul Gomez Rodriguez Date: Fri, 20 Mar 2026 15:54:34 -0700 Subject: [PATCH 2/4] Migrating from DefaultUnnamedMutex to Mutex --- Include/httpClient/pal.h | 21 +++++++++++---------- Source/Global/NetworkState.h | 2 +- Source/Global/global.cpp | 4 ++-- Source/Task/AsyncLib.cpp | 2 +- Source/Task/AtomicVector.h | 2 +- Source/Task/TaskQueueImpl.h | 10 +++++----- Source/Task/ThreadPool_stl.cpp | 4 ++-- Source/Task/WaitTimer_stl.cpp | 4 ++-- Source/WebSocket/hcwebsocket.h | 2 +- 9 files changed, 26 insertions(+), 25 deletions(-) diff --git a/Include/httpClient/pal.h b/Include/httpClient/pal.h index bf24550b8..b19b1297a 100644 --- a/Include/httpClient/pal.h +++ b/Include/httpClient/pal.h @@ -496,20 +496,21 @@ enum class HCWebSocketCloseStatus : uint32_t } -// Sony PS5 STL library defect: std::mutex without a name parameter creates named mutexes, -// which have a low limit. Use DefaultUnnamedMutex as a workaround so that mutexes are unnamed -// by default. -class DefaultUnnamedMutex : public std::mutex +// On some platforms, std::mutex default construction creates named mutexes which have a low +// system-wide limit. Mutex forces unnamed mutex construction on affected platforms. +#if HC_PLATFORM == HC_PLATFORM_SONY_PLAYSTATION_5 +class Mutex : public std::mutex { public: -#if __PROSPERO__ - DefaultUnnamedMutex() noexcept : std::mutex(nullptr) {} - ~DefaultUnnamedMutex() noexcept = default; - DefaultUnnamedMutex(DefaultUnnamedMutex const&) = delete; - DefaultUnnamedMutex& operator=(DefaultUnnamedMutex const&) = delete; + Mutex() noexcept : std::mutex(nullptr) {} + ~Mutex() noexcept = default; + Mutex(Mutex const&) = delete; + Mutex& operator=(Mutex const&) = delete; void lock() { std::mutex::lock(); } bool try_lock() { return std::mutex::try_lock(); } void unlock() { std::mutex::unlock(); } native_handle_type native_handle() { return std::mutex::native_handle(); } -#endif }; +#else +using Mutex = std::mutex; +#endif diff --git a/Source/Global/NetworkState.h b/Source/Global/NetworkState.h index 66b1abfae..b5ce077b7 100644 --- a/Source/Global/NetworkState.h +++ b/Source/Global/NetworkState.h @@ -76,7 +76,7 @@ class NetworkState static void CALLBACK HttpProviderCleanupComplete(XAsyncBlock* async); bool ScheduleCleanup(); - DefaultUnnamedMutex m_mutex; + Mutex m_mutex; UniquePtr m_httpProvider; diff --git a/Source/Global/global.cpp b/Source/Global/global.cpp index 2b3e84b8e..f7cff750c 100644 --- a/Source/Global/global.cpp +++ b/Source/Global/global.cpp @@ -25,11 +25,11 @@ HRESULT http_singleton::singleton_access( _Out_ std::shared_ptr& singleton ) noexcept { - static DefaultUnnamedMutex s_mutex; + static Mutex s_mutex; static std::shared_ptr s_singleton{ nullptr }; static uint8_t s_useCount{ 0 }; - std::lock_guard lock{ s_mutex }; + std::lock_guard lock{ s_mutex }; switch (mode) { case singleton_access_mode::create: diff --git a/Source/Task/AsyncLib.cpp b/Source/Task/AsyncLib.cpp index 023d07a82..3146fa3b9 100644 --- a/Source/Task/AsyncLib.cpp +++ b/Source/Task/AsyncLib.cpp @@ -45,7 +45,7 @@ struct AsyncState XAsyncBlock providerAsyncBlock { }; XAsyncBlock* userAsyncBlock = nullptr; XTaskQueueHandle queue = nullptr; - DefaultUnnamedMutex waitMutex; + Mutex waitMutex; std::condition_variable waitCondition; bool waitSatisfied = false; diff --git a/Source/Task/AtomicVector.h b/Source/Task/AtomicVector.h index 3227ff755..faf4a77a4 100644 --- a/Source/Task/AtomicVector.h +++ b/Source/Task/AtomicVector.h @@ -94,7 +94,7 @@ class AtomicVector private: - DefaultUnnamedMutex m_lock; + Mutex m_lock; std::vector m_buffers[2]; std::atomic m_indexAndRef { 0 }; }; diff --git a/Source/Task/TaskQueueImpl.h b/Source/Task/TaskQueueImpl.h index 7e4bfa5bf..ddb5d2cd6 100644 --- a/Source/Task/TaskQueueImpl.h +++ b/Source/Task/TaskQueueImpl.h @@ -114,7 +114,7 @@ class SubmitCallback }; std::atomic m_nextToken{ 0 }; - DefaultUnnamedMutex m_lock; + Mutex m_lock; CallbackRegistration m_buffer1[SUBMIT_CALLBACK_MAX]; CallbackRegistration m_buffer2[SUBMIT_CALLBACK_MAX]; CallbackRegistration* m_buffers[2]= { m_buffer1, m_buffer2 }; @@ -149,7 +149,7 @@ class QueueWaitRegistry std::atomic m_nextToken{ 0 }; StaticArray m_callbacks; - DefaultUnnamedMutex m_lock; + Mutex m_lock; }; class TaskQueuePortImpl: public Api @@ -257,12 +257,12 @@ class TaskQueuePortImpl: public Api std::atomic m_processingSerializedTbCallback{ 0 }; std::atomic m_processingCallback{ 0 }; std::condition_variable m_processingCallbackCv; - DefaultUnnamedMutex m_lock; + Mutex m_lock; std::unique_ptr> m_queueList; std::unique_ptr> m_pendingList; std::unique_ptr> m_terminationList; std::unique_ptr> m_pendingTerminationList; - DefaultUnnamedMutex m_terminationLock; + Mutex m_terminationLock; OS::WaitTimer m_timer; OS::ThreadPool m_threadPool; std::atomic m_timerDue = { UINT64_MAX }; @@ -465,7 +465,7 @@ class TaskQueueImpl : public Api struct TerminationData { bool terminated; - DefaultUnnamedMutex lock; + Mutex lock; std::condition_variable cv; }; diff --git a/Source/Task/ThreadPool_stl.cpp b/Source/Task/ThreadPool_stl.cpp index a429e3e9a..8f1a2e9d5 100644 --- a/Source/Task/ThreadPool_stl.cpp +++ b/Source/Task/ThreadPool_stl.cpp @@ -220,12 +220,12 @@ namespace OS std::atomic m_refs{ 1 }; - DefaultUnnamedMutex m_wakeLock; + Mutex m_wakeLock; std::condition_variable m_wake; uint32_t m_calls{ 0 }; bool m_terminate{ false }; - DefaultUnnamedMutex m_activeLock; + Mutex m_activeLock; std::condition_variable m_active; uint32_t m_activeCalls{ 0 }; diff --git a/Source/Task/WaitTimer_stl.cpp b/Source/Task/WaitTimer_stl.cpp index f4e098c7c..edbc88889 100644 --- a/Source/Task/WaitTimer_stl.cpp +++ b/Source/Task/WaitTimer_stl.cpp @@ -53,7 +53,7 @@ namespace OS TimerEntry const& Peek() const noexcept; TimerEntry Pop() noexcept; - DefaultUnnamedMutex m_mutex; + Mutex m_mutex; std::condition_variable m_cv; std::vector m_queue; // used as a heap std::thread m_t; @@ -64,7 +64,7 @@ namespace OS namespace { std::shared_ptr g_timerQueue; - DefaultUnnamedMutex g_timerQueueMutex; + Mutex g_timerQueueMutex; } TimerQueue::~TimerQueue() diff --git a/Source/WebSocket/hcwebsocket.h b/Source/WebSocket/hcwebsocket.h index daee11c0c..7eae0f830 100644 --- a/Source/WebSocket/hcwebsocket.h +++ b/Source/WebSocket/hcwebsocket.h @@ -181,7 +181,7 @@ class WebSocket : public std::enable_shared_from_this void* context{ nullptr }; }; - DefaultUnnamedMutex m_stateMutex; + Mutex m_stateMutex; enum class State { Initial, From 39bc60ae8d51169c194dcb0dd2e0ad45ece5f6db Mon Sep 17 00:00:00 2001 From: Raul Gomez Rodriguez Date: Fri, 20 Mar 2026 16:21:42 -0700 Subject: [PATCH 3/4] Revert renaming --- Include/httpClient/pal.h | 14 +++++++------- Source/Global/NetworkState.h | 2 +- Source/Global/global.cpp | 4 ++-- Source/Task/AsyncLib.cpp | 2 +- Source/Task/AtomicVector.h | 2 +- Source/Task/TaskQueueImpl.h | 10 +++++----- Source/Task/ThreadPool_stl.cpp | 4 ++-- Source/Task/WaitTimer_stl.cpp | 4 ++-- Source/WebSocket/hcwebsocket.h | 2 +- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Include/httpClient/pal.h b/Include/httpClient/pal.h index b19b1297a..1542ca106 100644 --- a/Include/httpClient/pal.h +++ b/Include/httpClient/pal.h @@ -497,20 +497,20 @@ enum class HCWebSocketCloseStatus : uint32_t } // On some platforms, std::mutex default construction creates named mutexes which have a low -// system-wide limit. Mutex forces unnamed mutex construction on affected platforms. +// system-wide limit. DefaultUnnamedMutex forces unnamed mutex construction on affected platforms. #if HC_PLATFORM == HC_PLATFORM_SONY_PLAYSTATION_5 -class Mutex : public std::mutex +class DefaultUnnamedMutex : public std::mutex { public: - Mutex() noexcept : std::mutex(nullptr) {} - ~Mutex() noexcept = default; - Mutex(Mutex const&) = delete; - Mutex& operator=(Mutex const&) = delete; + DefaultUnnamedMutex() noexcept : std::mutex(nullptr) {} + ~DefaultUnnamedMutex() noexcept = default; + DefaultUnnamedMutex(DefaultUnnamedMutex const&) = delete; + DefaultUnnamedMutex& operator=(DefaultUnnamedMutex const&) = delete; void lock() { std::mutex::lock(); } bool try_lock() { return std::mutex::try_lock(); } void unlock() { std::mutex::unlock(); } native_handle_type native_handle() { return std::mutex::native_handle(); } }; #else -using Mutex = std::mutex; +using DefaultUnnamedMutex = std::mutex; #endif diff --git a/Source/Global/NetworkState.h b/Source/Global/NetworkState.h index b5ce077b7..66b1abfae 100644 --- a/Source/Global/NetworkState.h +++ b/Source/Global/NetworkState.h @@ -76,7 +76,7 @@ class NetworkState static void CALLBACK HttpProviderCleanupComplete(XAsyncBlock* async); bool ScheduleCleanup(); - Mutex m_mutex; + DefaultUnnamedMutex m_mutex; UniquePtr m_httpProvider; diff --git a/Source/Global/global.cpp b/Source/Global/global.cpp index f7cff750c..2b3e84b8e 100644 --- a/Source/Global/global.cpp +++ b/Source/Global/global.cpp @@ -25,11 +25,11 @@ HRESULT http_singleton::singleton_access( _Out_ std::shared_ptr& singleton ) noexcept { - static Mutex s_mutex; + static DefaultUnnamedMutex s_mutex; static std::shared_ptr s_singleton{ nullptr }; static uint8_t s_useCount{ 0 }; - std::lock_guard lock{ s_mutex }; + std::lock_guard lock{ s_mutex }; switch (mode) { case singleton_access_mode::create: diff --git a/Source/Task/AsyncLib.cpp b/Source/Task/AsyncLib.cpp index 3146fa3b9..023d07a82 100644 --- a/Source/Task/AsyncLib.cpp +++ b/Source/Task/AsyncLib.cpp @@ -45,7 +45,7 @@ struct AsyncState XAsyncBlock providerAsyncBlock { }; XAsyncBlock* userAsyncBlock = nullptr; XTaskQueueHandle queue = nullptr; - Mutex waitMutex; + DefaultUnnamedMutex waitMutex; std::condition_variable waitCondition; bool waitSatisfied = false; diff --git a/Source/Task/AtomicVector.h b/Source/Task/AtomicVector.h index faf4a77a4..3227ff755 100644 --- a/Source/Task/AtomicVector.h +++ b/Source/Task/AtomicVector.h @@ -94,7 +94,7 @@ class AtomicVector private: - Mutex m_lock; + DefaultUnnamedMutex m_lock; std::vector m_buffers[2]; std::atomic m_indexAndRef { 0 }; }; diff --git a/Source/Task/TaskQueueImpl.h b/Source/Task/TaskQueueImpl.h index ddb5d2cd6..7e4bfa5bf 100644 --- a/Source/Task/TaskQueueImpl.h +++ b/Source/Task/TaskQueueImpl.h @@ -114,7 +114,7 @@ class SubmitCallback }; std::atomic m_nextToken{ 0 }; - Mutex m_lock; + DefaultUnnamedMutex m_lock; CallbackRegistration m_buffer1[SUBMIT_CALLBACK_MAX]; CallbackRegistration m_buffer2[SUBMIT_CALLBACK_MAX]; CallbackRegistration* m_buffers[2]= { m_buffer1, m_buffer2 }; @@ -149,7 +149,7 @@ class QueueWaitRegistry std::atomic m_nextToken{ 0 }; StaticArray m_callbacks; - Mutex m_lock; + DefaultUnnamedMutex m_lock; }; class TaskQueuePortImpl: public Api @@ -257,12 +257,12 @@ class TaskQueuePortImpl: public Api std::atomic m_processingSerializedTbCallback{ 0 }; std::atomic m_processingCallback{ 0 }; std::condition_variable m_processingCallbackCv; - Mutex m_lock; + DefaultUnnamedMutex m_lock; std::unique_ptr> m_queueList; std::unique_ptr> m_pendingList; std::unique_ptr> m_terminationList; std::unique_ptr> m_pendingTerminationList; - Mutex m_terminationLock; + DefaultUnnamedMutex m_terminationLock; OS::WaitTimer m_timer; OS::ThreadPool m_threadPool; std::atomic m_timerDue = { UINT64_MAX }; @@ -465,7 +465,7 @@ class TaskQueueImpl : public Api struct TerminationData { bool terminated; - Mutex lock; + DefaultUnnamedMutex lock; std::condition_variable cv; }; diff --git a/Source/Task/ThreadPool_stl.cpp b/Source/Task/ThreadPool_stl.cpp index 8f1a2e9d5..a429e3e9a 100644 --- a/Source/Task/ThreadPool_stl.cpp +++ b/Source/Task/ThreadPool_stl.cpp @@ -220,12 +220,12 @@ namespace OS std::atomic m_refs{ 1 }; - Mutex m_wakeLock; + DefaultUnnamedMutex m_wakeLock; std::condition_variable m_wake; uint32_t m_calls{ 0 }; bool m_terminate{ false }; - Mutex m_activeLock; + DefaultUnnamedMutex m_activeLock; std::condition_variable m_active; uint32_t m_activeCalls{ 0 }; diff --git a/Source/Task/WaitTimer_stl.cpp b/Source/Task/WaitTimer_stl.cpp index edbc88889..f4e098c7c 100644 --- a/Source/Task/WaitTimer_stl.cpp +++ b/Source/Task/WaitTimer_stl.cpp @@ -53,7 +53,7 @@ namespace OS TimerEntry const& Peek() const noexcept; TimerEntry Pop() noexcept; - Mutex m_mutex; + DefaultUnnamedMutex m_mutex; std::condition_variable m_cv; std::vector m_queue; // used as a heap std::thread m_t; @@ -64,7 +64,7 @@ namespace OS namespace { std::shared_ptr g_timerQueue; - Mutex g_timerQueueMutex; + DefaultUnnamedMutex g_timerQueueMutex; } TimerQueue::~TimerQueue() diff --git a/Source/WebSocket/hcwebsocket.h b/Source/WebSocket/hcwebsocket.h index 7eae0f830..daee11c0c 100644 --- a/Source/WebSocket/hcwebsocket.h +++ b/Source/WebSocket/hcwebsocket.h @@ -181,7 +181,7 @@ class WebSocket : public std::enable_shared_from_this void* context{ nullptr }; }; - Mutex m_stateMutex; + DefaultUnnamedMutex m_stateMutex; enum class State { Initial, From aa24f38908502347d7853049bc8cca0f8e76f988 Mon Sep 17 00:00:00 2001 From: Raul Gomez Rodriguez Date: Mon, 23 Mar 2026 17:25:45 -0700 Subject: [PATCH 4/4] Using macro instead of HC_PLATFORM --- Include/httpClient/pal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Include/httpClient/pal.h b/Include/httpClient/pal.h index 1542ca106..7919636b5 100644 --- a/Include/httpClient/pal.h +++ b/Include/httpClient/pal.h @@ -498,7 +498,8 @@ enum class HCWebSocketCloseStatus : uint32_t // On some platforms, std::mutex default construction creates named mutexes which have a low // system-wide limit. DefaultUnnamedMutex forces unnamed mutex construction on affected platforms. -#if HC_PLATFORM == HC_PLATFORM_SONY_PLAYSTATION_5 +// Define HC_USE_UNNAMED_MUTEX in your platform build props to enable the workaround. +#if defined(HC_USE_UNNAMED_MUTEX) class DefaultUnnamedMutex : public std::mutex { public: