[redcode/crythread-2nd-pass] replaced remaining CrySpinLock/CryWriteLock usage with equivalent AZStd version

Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com>
This commit is contained in:
AMZN-ScottR
2021-08-11 15:54:59 -07:00
parent 6c83dcd702
commit 5a891c8cbd
3 changed files with 13 additions and 33 deletions
+4 -3
View File
@@ -18,6 +18,7 @@
#include <AzCore/Debug/StackTracer.h>
#include <AzCore/Debug/EventTraceDrillerBus.h>
#include <AzCore/std/parallel/spin_mutex.h>
#define VS_VERSION_INFO 1
#define IDD_CRITICAL_ERROR 101
@@ -152,13 +153,13 @@ void DebugCallStack::SetUserDialogEnable(const bool bUserDialogEnable)
DWORD g_idDebugThreads[10];
const char* g_nameDebugThreads[10];
int g_nDebugThreads = 0;
volatile int g_lockThreadDumpList = 0;
AZStd::spin_mutex g_lockThreadDumpList = 0;
void MarkThisThreadForDebugging(const char* name)
{
EBUS_EVENT(AZ::Debug::EventTraceDrillerSetupBus, SetThreadName, AZStd::this_thread::get_id(), name);
WriteLock lock(g_lockThreadDumpList);
AZStd::lock_guard<AZStd::spin_mutex> lock(g_lockThreadDumpList);
DWORD id = GetCurrentThreadId();
if (g_nDebugThreads == sizeof(g_idDebugThreads) / sizeof(g_idDebugThreads[0]))
{
@@ -178,7 +179,7 @@ void MarkThisThreadForDebugging(const char* name)
void UnmarkThisThreadFromDebugging()
{
WriteLock lock(g_lockThreadDumpList);
AZStd::lock_guard<AZStd::spin_mutex> lock(g_lockThreadDumpList);
DWORD id = GetCurrentThreadId();
for (int i = g_nDebugThreads - 1; i >= 0; i--)
{