AuroraRuntime/Source/Threading/Primitives/ConditionVariable.Unix.hpp
Reece f559897b42 [+] Added WorkerId_t structure
[-] Removed WorkerId_t typedef
[*] Added shared support to some older threading apis that have yet to be updated
2021-10-08 20:51:34 +01:00

29 lines
724 B
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: ConditionVariable.Unix.hpp
Date: 2021-6-12
Author: Reece
***/
#pragma once
#if !defined(_AURUNTIME_GENERICCV)
namespace Aurora::Threading::Primitives
{
class ConditionVariableImpl : public IConditionVariable
{
public:
ConditionVariableImpl(const AuSPtr<IConditionMutex> &mutex);
~ConditionVariableImpl();
AuSPtr<IConditionMutex> GetMutex() override;
bool WaitForSignal(AuUInt32 timeout) override;
void Signal() override;
void Broadcast() override;
private:
pthread_cond_t pthreadCv_;
AuSPtr<IConditionMutexEx> mutex_;
};
}
#endif