29 lines
696 B
C++
29 lines
696 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(IConditionMutex *mutex);
|
|
~ConditionVariableImpl();
|
|
|
|
IConditionMutex *GetMutex() override;
|
|
bool WaitForSignal(AuUInt32 timeout) override;
|
|
void Signal() override;
|
|
void Broadcast() override;
|
|
|
|
private:
|
|
pthread_cond_t pthreadCv_;
|
|
IConditionMutexEx *mutex_;
|
|
};
|
|
}
|
|
#endif |