Reece
046b70d7bc
...on apis that predate those kernel revisions. so, technically this might be able to run on xp. [*] GetThreadCookie optimization for all platforms
30 lines
786 B
C++
30 lines
786 B
C++
/***
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: AuConditionVariable.Unix.hpp
|
|
Date: 2021-6-12
|
|
Author: Reece
|
|
***/
|
|
#pragma once
|
|
|
|
#if !defined(_AURUNTIME_GENERICCV)
|
|
namespace Aurora::Threading::Primitives
|
|
{
|
|
struct ConditionVariableImpl : IConditionVariable
|
|
{
|
|
ConditionVariableImpl(const AuSPtr<IConditionMutex> &mutex);
|
|
~ConditionVariableImpl();
|
|
|
|
AuSPtr<IConditionMutex> GetMutex() override;
|
|
bool WaitForSignal(AuUInt32 timeout) override;
|
|
bool WaitForSignalNS(AuUInt64 timeout) override;
|
|
void Signal() override;
|
|
void Broadcast() override;
|
|
|
|
// TODO: ...
|
|
pthread_cond_t pthreadCv_;
|
|
private:
|
|
AuSPtr<IConditionMutexEx> mutex_;
|
|
};
|
|
}
|
|
#endif |