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

52 lines
1010 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.
File: ConditionMutex.Unix.cpp
Date: 2021-6-12
Author: Reece
***/
2021-09-30 14:57:41 +00:00
#include <Source/RuntimeInternal.hpp>
2021-06-27 21:25:29 +00:00
#include "ConditionMutex.Generic.hpp"
#if !defined(_AURUNTIME_GENERICCM)
2021-09-30 14:57:41 +00:00
#include <Source/Time/Time.hpp>
2021-06-27 21:25:29 +00:00
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)
{
AuSafeDelete<UnixConditionMutex *>(mutex);
2021-06-27 21:25:29 +00:00
}
}
#endif