[redcode/crythread-2nd-pass] removed or replaced remaining CryMutex/CryLock 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-10 20:35:55 -07:00
parent 3bf4caf7d2
commit f99f1f00f4
15 changed files with 39 additions and 56 deletions
+2 -2
View File
@@ -72,7 +72,7 @@ bool CryAssert(const char* szCondition, const char* szFile, unsigned int line, b
static const int max_len = 4096;
static char gs_command_str[4096];
static CryLockT<CRYLOCK_RECURSIVE> lock;
static AZStd::recursive_mutex lock;
gEnv->pSystem->OnAssert(szCondition, gs_szMessage, szFile, line);
@@ -80,7 +80,7 @@ bool CryAssert(const char* szCondition, const char* szFile, unsigned int line, b
if (!gEnv->bNoAssertDialog && !gEnv->bIgnoreAllAsserts)
{
CryAutoLock< CryLockT<CRYLOCK_RECURSIVE> > lk (lock);
AZStd::lock_guard<AZStd::recursive_mutex> 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);
-2
View File
@@ -70,8 +70,6 @@ bool CryAssert(const char* szCondition, const char* szFile, unsigned int line, b
static const int max_len = 4096;
static char gs_command_str[4096];
static CryLockT<CRYLOCK_RECURSIVE> lock;
gEnv->pSystem->OnAssert(szCondition, gs_szMessage, szFile, line);
size_t file_len = strlen(szFile);
-2
View File
@@ -432,8 +432,6 @@ struct IMaterial
virtual uint32 GetDccMaterialHash() const = 0;
virtual void SetDccMaterialHash(uint32 hash) = 0;
virtual CryCriticalSection& GetSubMaterialResizeLock() = 0;
virtual void UpdateShaderItems() = 0;
// </interfuscator:shuffle>
@@ -34,7 +34,7 @@ namespace CryMT
public:
typedef T value_type;
typedef std::vector<T, Alloc> container_type;
typedef CryAutoCriticalSection AutoLock;
typedef AZStd::lock_guard<AZStd::recursive_mutex> AutoLock;
//////////////////////////////////////////////////////////////////////////
// std::queue interface
@@ -46,7 +46,7 @@ namespace CryMT
// classic pop function of queue should not be used for thread safety, use try_pop instead
//void pop() { AutoLock lock(m_cs); return v.erase(v.begin()); };
CryCriticalSection& get_lock() const { return m_cs; }
AZStd::recursive_mutex& get_lock() const { return m_cs; }
bool empty() const { AutoLock lock(m_cs); return v.empty(); }
int size() const { AutoLock lock(m_cs); return v.size(); }
@@ -92,7 +92,7 @@ namespace CryMT
}
private:
container_type v;
mutable CryCriticalSection m_cs;
mutable AZStd::recursive_mutex m_cs;
};
}; // namespace CryMT