diff options
author | Beq <beqjanus@gmail.com> | 2024-02-19 15:13:25 +0000 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-02-19 18:11:17 +0200 |
commit | fd7f817171f9842470e83832c67d48065e81ca01 (patch) | |
tree | 5be92cc3262f6c4c244bfc8f758c32af21ce53f3 /indra/llcommon/llmutex.h | |
parent | 5486d87b566aabb43fa585de3ee86e5bc77391c9 (diff) |
[Linux]gcc is broken for in place template instantiation.
Diffstat (limited to 'indra/llcommon/llmutex.h')
-rw-r--r-- | indra/llcommon/llmutex.h | 42 |
1 files changed, 36 insertions, 6 deletions
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<bool SHARED> void lock(); - template<> void lock<true>() { lockShared(); } - template<> void lock<false>() { lockExclusive(); } bool trylockShared(); bool trylockExclusive(); template<bool SHARED> bool trylock(); - template<> bool trylock<true>() { return trylockShared(); } - template<> bool trylock<false>() { return trylockExclusive(); } void unlockShared(); void unlockExclusive(); template<bool SHARED> void unlock(); - template<> void unlock<true>() { unlockShared(); } - template<> void unlock<false>() { unlockExclusive(); } private: std::shared_mutex mSharedMutex; @@ -107,6 +101,42 @@ private: using const_iterator = std::unordered_map<LLThread::id_t, U32>::const_iterator; }; +template<> +inline void LLSharedMutex::lock<true>() +{ + lockShared(); +} + +template<> +inline void LLSharedMutex::lock<false>() +{ + lockExclusive(); +} + +template<> +inline bool LLSharedMutex::trylock<true>() +{ + return trylockShared(); +} + +template<> +inline bool LLSharedMutex::trylock<false>() +{ + return trylockExclusive(); +} + +template<> +inline void LLSharedMutex::unlock<true>() +{ + unlockShared(); +} + +template<> +inline void LLSharedMutex::unlock<false>() +{ + unlockExclusive(); +} + // Actually a condition/mutex pair (since each condition needs to be associated with a mutex). class LL_COMMON_API LLCondition : public LLMutex { |