AuroraRuntime/Source/Threading/Primitives/ConditionMutex.Unix.cpp

52 lines
1008 B
C++

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