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

51 lines
1003 B
C++
Raw Normal View History

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