[redcode/crythread-2nd-pass] replaced instances of AZStd::lock_guard<> with AZStd::scoped_lock as per feedback
Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com>
This commit is contained in:
@@ -80,7 +80,7 @@ bool CryAssert(const char* szCondition, const char* szFile, unsigned int line, b
|
||||
|
||||
if (!gEnv->bNoAssertDialog && !gEnv->bIgnoreAllAsserts)
|
||||
{
|
||||
AZStd::lock_guard<AZStd::recursive_mutex> lk (lock);
|
||||
AZStd::scoped_lock lk(lock);
|
||||
snprintf(gs_command_str, max_len, "xterm -geometry 100x20 -n 'Assert Dialog [Linux Launcher]' -T 'Assert Dialog [Linux Launcher]' -e 'BinLinux/assert_term \"%s\" \"%s\" %d \"%s\"; echo \"$?\" > .assert_return'",
|
||||
szCondition, (file_len > 60) ? szFile + (file_len - 61) : szFile, line, gs_szMessage);
|
||||
int ret = system(gs_command_str);
|
||||
|
||||
@@ -154,13 +154,13 @@ void DebugCallStack::SetUserDialogEnable(const bool bUserDialogEnable)
|
||||
DWORD g_idDebugThreads[10];
|
||||
const char* g_nameDebugThreads[10];
|
||||
int g_nDebugThreads = 0;
|
||||
AZStd::spin_mutex g_lockThreadDumpList = 0;
|
||||
AZStd::spin_mutex g_lockThreadDumpList;
|
||||
|
||||
void MarkThisThreadForDebugging(const char* name)
|
||||
{
|
||||
EBUS_EVENT(AZ::Debug::EventTraceDrillerSetupBus, SetThreadName, AZStd::this_thread::get_id(), name);
|
||||
|
||||
AZStd::lock_guard<AZStd::spin_mutex> lock(g_lockThreadDumpList);
|
||||
AZStd::scoped_lock lock(g_lockThreadDumpList);
|
||||
DWORD id = GetCurrentThreadId();
|
||||
if (g_nDebugThreads == sizeof(g_idDebugThreads) / sizeof(g_idDebugThreads[0]))
|
||||
{
|
||||
@@ -180,7 +180,7 @@ void MarkThisThreadForDebugging(const char* name)
|
||||
|
||||
void UnmarkThisThreadFromDebugging()
|
||||
{
|
||||
AZStd::lock_guard<AZStd::spin_mutex> lock(g_lockThreadDumpList);
|
||||
AZStd::scoped_lock lock(g_lockThreadDumpList);
|
||||
DWORD id = GetCurrentThreadId();
|
||||
for (int i = g_nDebugThreads - 1; i >= 0; i--)
|
||||
{
|
||||
|
||||
@@ -810,13 +810,13 @@ void CLog::PushAssetScopeName(const char* sAssetType, const char* sName)
|
||||
SAssetScopeInfo as;
|
||||
as.sType = sAssetType;
|
||||
as.sName = sName;
|
||||
AZStd::lock_guard<AZStd::mutex> scope_lock(m_assetScopeQueueLock);
|
||||
AZStd::scoped_lock scope_lock(m_assetScopeQueueLock);
|
||||
m_assetScopeQueue.push_back(as);
|
||||
}
|
||||
|
||||
void CLog::PopAssetScopeName()
|
||||
{
|
||||
AZStd::lock_guard<AZStd::mutex> scope_lock(m_assetScopeQueueLock);
|
||||
AZStd::scoped_lock scope_lock(m_assetScopeQueueLock);
|
||||
assert(!m_assetScopeQueue.empty());
|
||||
if (!m_assetScopeQueue.empty())
|
||||
{
|
||||
@@ -827,7 +827,7 @@ void CLog::PopAssetScopeName()
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
const char* CLog::GetAssetScopeString()
|
||||
{
|
||||
AZStd::lock_guard<AZStd::mutex> scope_lock(m_assetScopeQueueLock);
|
||||
AZStd::scoped_lock scope_lock(m_assetScopeQueueLock);
|
||||
|
||||
m_assetScopeString.clear();
|
||||
for (size_t i = 0; i < m_assetScopeQueue.size(); i++)
|
||||
@@ -1450,7 +1450,7 @@ void CLog::Update()
|
||||
{
|
||||
if (!m_threadSafeMsgQueue.empty())
|
||||
{
|
||||
AZStd::lock_guard<AZStd::recursive_mutex> lock(m_threadSafeMsgQueue.get_lock()); // Get the lock and hold onto it until we clear the entire queue (prevents other threads adding more things in while we clear it)
|
||||
AZStd::scoped_lock lock(m_threadSafeMsgQueue.get_lock()); // Get the lock and hold onto it until we clear the entire queue (prevents other threads adding more things in while we clear it)
|
||||
// Must be called from main thread
|
||||
SLogMsg msg;
|
||||
while (m_threadSafeMsgQueue.try_pop(msg))
|
||||
|
||||
Reference in New Issue
Block a user