50 lines
1005 B
C++
50 lines
1005 B
C++
/***
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: ConditionMutex.Win32.cpp
|
|
Date: 2021-6-12
|
|
Author: Reece
|
|
***/
|
|
#include <Source/RuntimeInternal.hpp>
|
|
#include "ConditionMutex.Generic.hpp"
|
|
|
|
#if !defined(_AURUNTIME_GENERICCM)
|
|
|
|
namespace Aurora::Threading::Primitives
|
|
{
|
|
Win32ConditionMutex::Win32ConditionMutex()
|
|
{
|
|
InitializeSRWLock(&lock_);
|
|
}
|
|
|
|
Win32ConditionMutex::~Win32ConditionMutex()
|
|
{
|
|
}
|
|
|
|
void Win32ConditionMutex::Lock()
|
|
{
|
|
AcquireSRWLockExclusive(&lock_);
|
|
}
|
|
|
|
void Win32ConditionMutex::Unlock()
|
|
{
|
|
ReleaseSRWLockExclusive(&lock_);
|
|
}
|
|
|
|
AuUInt Win32ConditionMutex::GetOSHandle()
|
|
{
|
|
return reinterpret_cast<AuUInt>(&lock_);
|
|
}
|
|
|
|
AUKN_SYM IConditionMutex *ConditionMutexNew()
|
|
{
|
|
return _new Win32ConditionMutex();
|
|
}
|
|
|
|
AUKN_SYM void ConditionMutexRelease(IConditionMutex * mutex)
|
|
{
|
|
SafeDelete<Win32ConditionMutex *>(mutex);
|
|
}
|
|
}
|
|
|
|
#endif |