[redcode/crythread-2nd-pass] removed Cry*CriticalSection functions
Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com>
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
|
||||
// Include architecture specific code.
|
||||
#if defined(LINUX) || defined(APPLE)
|
||||
#include <CryThreadImpl_pthreads.h>
|
||||
// noting to include
|
||||
#define AZ_RESTRICTED_SECTION_IMPLEMENTED
|
||||
#elif defined(WIN32) || defined(WIN64)
|
||||
#include <CryThreadImpl_windows.h>
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_CRYTHREADIMPL_PTHREADS_H
|
||||
#define CRYINCLUDE_CRYCOMMON_CRYTHREADIMPL_PTHREADS_H
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "CryThread_pthreads.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// CryCriticalSection implementation
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
typedef CryLockT<CRYLOCK_RECURSIVE> TCritSecType;
|
||||
|
||||
void CryDeleteCriticalSection(void* cs)
|
||||
{
|
||||
delete ((TCritSecType*)cs);
|
||||
}
|
||||
|
||||
void CryEnterCriticalSection(void* cs)
|
||||
{
|
||||
((TCritSecType*)cs)->Lock();
|
||||
}
|
||||
|
||||
bool CryTryCriticalSection(void* cs)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void CryLeaveCriticalSection(void* cs)
|
||||
{
|
||||
((TCritSecType*)cs)->Unlock();
|
||||
}
|
||||
|
||||
void CryCreateCriticalSectionInplace(void* pCS)
|
||||
{
|
||||
new (pCS) TCritSecType;
|
||||
}
|
||||
|
||||
void CryDeleteCriticalSectionInplace(void*)
|
||||
{
|
||||
}
|
||||
|
||||
void* CryCreateCriticalSection()
|
||||
{
|
||||
return (void*) new TCritSecType;
|
||||
}
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_CRYTHREADIMPL_PTHREADS_H
|
||||
@@ -48,14 +48,6 @@ LONG CryInterlockedCompareExchange(LONG volatile* dst, LONG exchange, LONG c
|
||||
void* CryInterlockedCompareExchangePointer(void* volatile* dst, void* exchange, void* comperand);
|
||||
void* CryInterlockedExchangePointer (void* volatile* dst, void* exchange);
|
||||
|
||||
void* CryCreateCriticalSection();
|
||||
void CryCreateCriticalSectionInplace(void*);
|
||||
void CryDeleteCriticalSection(void* cs);
|
||||
void CryDeleteCriticalSectionInplace(void* cs);
|
||||
void CryEnterCriticalSection(void* cs);
|
||||
bool CryTryCriticalSection(void* cs);
|
||||
void CryLeaveCriticalSection(void* cs);
|
||||
|
||||
#if defined(AZ_RESTRICTED_PLATFORM)
|
||||
#define AZ_RESTRICTED_SECTION MULTITHREAD_H_SECTION_DEFINE_CRYINTERLOCKEXCHANGE
|
||||
#include AZ_RESTRICTED_FILE(MultiThread_h)
|
||||
|
||||
@@ -162,7 +162,6 @@ set(FILES
|
||||
CryLibrary.h
|
||||
CryThread_pthreads.h
|
||||
CryThread_windows.h
|
||||
CryThreadImpl_pthreads.h
|
||||
CryThreadImpl_windows.h
|
||||
CryWindows.h
|
||||
Linux32Specific.h
|
||||
|
||||
@@ -364,59 +364,6 @@ void CryInterlockedAdd(volatile size_t* pVal, ptrdiff_t iAdd)
|
||||
assert((iAdd == 0) || (iAdd < 0 && v < v - (size_t)iAdd) || (iAdd > 0 && v > v - (size_t)iAdd));
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void* CryCreateCriticalSection()
|
||||
{
|
||||
CRITICAL_SECTION* pCS = new CRITICAL_SECTION;
|
||||
InitializeCriticalSection(pCS);
|
||||
return pCS;
|
||||
}
|
||||
|
||||
void CryCreateCriticalSectionInplace(void* pCS)
|
||||
{
|
||||
InitializeCriticalSection((CRITICAL_SECTION*)pCS);
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CryDeleteCriticalSection(void* cs)
|
||||
{
|
||||
CRITICAL_SECTION* pCS = (CRITICAL_SECTION*)cs;
|
||||
if (pCS->LockCount >= 0)
|
||||
{
|
||||
CryFatalError("Critical Section hanging lock");
|
||||
}
|
||||
DeleteCriticalSection(pCS);
|
||||
delete pCS;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CryDeleteCriticalSectionInplace(void* cs)
|
||||
{
|
||||
CRITICAL_SECTION* pCS = (CRITICAL_SECTION*)cs;
|
||||
if (pCS->LockCount >= 0)
|
||||
{
|
||||
CryFatalError("Critical Section hanging lock");
|
||||
}
|
||||
DeleteCriticalSection(pCS);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CryEnterCriticalSection(void* cs)
|
||||
{
|
||||
EnterCriticalSection((CRITICAL_SECTION*)cs);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CryTryCriticalSection(void* cs)
|
||||
{
|
||||
return TryEnterCriticalSection((CRITICAL_SECTION*)cs) != 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CryLeaveCriticalSection(void* cs)
|
||||
{
|
||||
LeaveCriticalSection((CRITICAL_SECTION*)cs);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
uint32 CryGetFileAttributes(const char* lpFileName)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user