AuroraRuntime/Source/Threading/Primitives/AuConditionMutex.Generic.cpp

51 lines
1003 B
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: AuConditionMutex.Generic.cpp
Date: 2021-6-14
Author: Reece
***/
#include <Source/RuntimeInternal.hpp>
#include "AuConditionMutex.Generic.hpp"
#if defined(_AURUNTIME_GENERICCM)
namespace Aurora::Threading::Primitives
{
ConditionMutexImpl::ConditionMutexImpl()
{
}
ConditionMutexImpl::~ConditionMutexImpl()
{
}
void ConditionMutexImpl::Lock()
{
this->mutex_.Lock();
}
void ConditionMutexImpl::Unlock()
{
this->mutex_.Unlock()
}
AuUInt ConditionMutexImpl::GetOSHandle()
{
AuMach handle = 0;
SysAssertExp(this->mutex_.HasOSHandle(handle));
return handle;
}
AUKN_SYM IConditionMutex *ConditionMutexNew()
{
return _new ConditionMutexImpl();
}
AUKN_SYM void ConditionMutexRelease(IConditionMutex *pMutex)
{
AuSafeDelete<ConditionMutexImpl *>(pMutex);
}
}
#endif