From 229d80b439813b321967ca1cceddd9b8c0888652 Mon Sep 17 00:00:00 2001 From: kkhalid Date: Fri, 29 Apr 2022 10:17:54 -0700 Subject: [PATCH] Update win32_threading.cpp fixing compilation errors with clang-cl: "template specialization requires 'template<>" --- renderdoc/os/win32/win32_threading.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/renderdoc/os/win32/win32_threading.cpp b/renderdoc/os/win32/win32_threading.cpp index 7cfcb59b8..4cc93d499 100644 --- a/renderdoc/os/win32/win32_threading.cpp +++ b/renderdoc/os/win32/win32_threading.cpp @@ -87,65 +87,78 @@ int32_t CmpExch32(int32_t *dest, int32_t oldVal, int32_t newVal) namespace Threading { +template <> CriticalSection::CriticalSectionTemplate() { InitializeCriticalSection(&m_Data); } +template <> CriticalSection::~CriticalSectionTemplate() { DeleteCriticalSection(&m_Data); } +template <> void CriticalSection::Lock() { EnterCriticalSection(&m_Data); } +template <> bool CriticalSection::Trylock() { return TryEnterCriticalSection(&m_Data) != FALSE; } +template <> void CriticalSection::Unlock() { LeaveCriticalSection(&m_Data); } +template <> RWLock::RWLockTemplate() { InitializeSRWLock(&m_Data); } +template <> RWLock::~RWLockTemplate() { } +template <> void RWLock::WriteLock() { AcquireSRWLockExclusive(&m_Data); } +template <> bool RWLock::TryWritelock() { return TryAcquireSRWLockExclusive(&m_Data) != FALSE; } +template <> void RWLock::WriteUnlock() { ReleaseSRWLockExclusive(&m_Data); } +template <> void RWLock::ReadLock() { AcquireSRWLockShared(&m_Data); } +template <> bool RWLock::TryReadlock() { return TryAcquireSRWLockShared(&m_Data) != FALSE; } +template <> void RWLock::ReadUnlock() { ReleaseSRWLockShared(&m_Data);