From fd7f817171f9842470e83832c67d48065e81ca01 Mon Sep 17 00:00:00 2001 From: Beq Date: Mon, 19 Feb 2024 15:13:25 +0000 Subject: [Linux]gcc is broken for in place template instantiation. --- indra/llcommon/llmutex.h | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llmutex.h b/indra/llcommon/llmutex.h index 077f810d61..cef58c1c9d 100644 --- a/indra/llcommon/llmutex.h +++ b/indra/llcommon/llmutex.h @@ -82,20 +82,14 @@ public: void lockShared(); void lockExclusive(); template void lock(); - template<> void lock() { lockShared(); } - template<> void lock() { lockExclusive(); } bool trylockShared(); bool trylockExclusive(); template bool trylock(); - template<> bool trylock() { return trylockShared(); } - template<> bool trylock() { return trylockExclusive(); } void unlockShared(); void unlockExclusive(); template void unlock(); - template<> void unlock() { unlockShared(); } - template<> void unlock() { unlockExclusive(); } private: std::shared_mutex mSharedMutex; @@ -107,6 +101,42 @@ private: using const_iterator = std::unordered_map::const_iterator; }; +template<> +inline void LLSharedMutex::lock() +{ + lockShared(); +} + +template<> +inline void LLSharedMutex::lock() +{ + lockExclusive(); +} + +template<> +inline bool LLSharedMutex::trylock() +{ + return trylockShared(); +} + +template<> +inline bool LLSharedMutex::trylock() +{ + return trylockExclusive(); +} + +template<> +inline void LLSharedMutex::unlock() +{ + unlockShared(); +} + +template<> +inline void LLSharedMutex::unlock() +{ + unlockExclusive(); +} + // Actually a condition/mutex pair (since each condition needs to be associated with a mutex). class LL_COMMON_API LLCondition : public LLMutex { -- cgit v1.2.3