[*] Redo d520b0ce
with the lost semaphore copy described in the commit comment
(wtf? did i stash something at the wrong time?)
This commit is contained in:
parent
22136a8ae2
commit
c3e898d53d
@ -12,6 +12,10 @@
|
|||||||
|
|
||||||
namespace Aurora::Threading::Waitables
|
namespace Aurora::Threading::Waitables
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Are you looking for AuFutexSemaphore::LockUntilExactlyEqualAbsNS timeline barriers/semaphores?
|
||||||
|
* This is a counting primitive of a binary signal state for syncing threads against work-group completion or a single work-group ready step.
|
||||||
|
*/
|
||||||
struct FutexBarrier final
|
struct FutexBarrier final
|
||||||
{
|
{
|
||||||
inline constexpr FutexBarrier(AuUInt32 uExpectThreads) :
|
inline constexpr FutexBarrier(AuUInt32 uExpectThreads) :
|
||||||
|
@ -9,19 +9,13 @@
|
|||||||
|
|
||||||
#include "../WakeOnAddress.hpp"
|
#include "../WakeOnAddress.hpp"
|
||||||
#include "../SpinTime.hpp"
|
#include "../SpinTime.hpp"
|
||||||
|
#include "_.inl"
|
||||||
|
|
||||||
namespace Aurora::Threading::Waitables
|
namespace Aurora::Threading::Waitables
|
||||||
{
|
{
|
||||||
struct FutexCondWaitable final
|
struct FutexCondWaitable final
|
||||||
{
|
{
|
||||||
inline constexpr FutexCondWaitable()
|
AURT_WAITABLE_NULL_CTORS_DEF(FutexCondWaitable)
|
||||||
{}
|
|
||||||
AU_MOVE(FutexCondWaitable)
|
|
||||||
inline constexpr FutexCondWaitable(const FutexCondWaitable &that)
|
|
||||||
{
|
|
||||||
// NOP
|
|
||||||
}
|
|
||||||
AU_OPERATOR_COPY(FutexCondWaitable)
|
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
inline bool WaitNS(T pWaitable, AuUInt64 uRelativeNanoseconds)
|
inline bool WaitNS(T pWaitable, AuUInt64 uRelativeNanoseconds)
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include "../WakeOnAddress.hpp"
|
#include "../WakeOnAddress.hpp"
|
||||||
#include "../SpinTime.hpp"
|
#include "../SpinTime.hpp"
|
||||||
|
#include "_.inl"
|
||||||
|
|
||||||
namespace Aurora::Threading::Waitables
|
namespace Aurora::Threading::Waitables
|
||||||
{
|
{
|
||||||
@ -16,12 +17,13 @@ namespace Aurora::Threading::Waitables
|
|||||||
{
|
{
|
||||||
inline constexpr FutexSemaphoreWaitable()
|
inline constexpr FutexSemaphoreWaitable()
|
||||||
{}
|
{}
|
||||||
AU_MOVE(FutexSemaphoreWaitable)
|
inline constexpr FutexSemaphoreWaitable(const FutexSemaphoreWaitable & that) :
|
||||||
inline constexpr FutexSemaphoreWaitable(const FutexSemaphoreWaitable &that)
|
uAtomicState(that.uAtomicState)
|
||||||
{
|
{ }
|
||||||
// NOP
|
inline constexpr FutexSemaphoreWaitable(FutexSemaphoreWaitable &&that) :
|
||||||
}
|
uAtomicState(that.uAtomicState)
|
||||||
AU_OPERATOR_COPY(FutexSemaphoreWaitable)
|
{ }
|
||||||
|
AURT_WAITABLE_COPY_OPERATORS(FutexSemaphoreWaitable)
|
||||||
|
|
||||||
inline auline bool TryLockNoSpin()
|
inline auline bool TryLockNoSpin()
|
||||||
{
|
{
|
||||||
|
@ -9,19 +9,13 @@
|
|||||||
|
|
||||||
#include "../WakeOnAddress.hpp"
|
#include "../WakeOnAddress.hpp"
|
||||||
#include "../SpinTime.hpp"
|
#include "../SpinTime.hpp"
|
||||||
|
#include "_.inl"
|
||||||
|
|
||||||
namespace Aurora::Threading::Waitables
|
namespace Aurora::Threading::Waitables
|
||||||
{
|
{
|
||||||
struct FutexWaitable final : IWaitable
|
struct FutexWaitable final : IWaitable
|
||||||
{
|
{
|
||||||
inline constexpr FutexWaitable()
|
AURT_WAITABLE_NULL_CTORS_DEF(FutexWaitable)
|
||||||
{}
|
|
||||||
AU_MOVE(FutexWaitable)
|
|
||||||
inline constexpr FutexWaitable(const FutexWaitable &that)
|
|
||||||
{
|
|
||||||
// NOP
|
|
||||||
}
|
|
||||||
AU_OPERATOR_COPY(FutexWaitable)
|
|
||||||
|
|
||||||
inline bool TryLockNoSpin()
|
inline bool TryLockNoSpin()
|
||||||
{
|
{
|
||||||
@ -160,14 +154,7 @@ namespace Aurora::Threading::Waitables
|
|||||||
|
|
||||||
struct FutexWaitableNoVTblMovable final
|
struct FutexWaitableNoVTblMovable final
|
||||||
{
|
{
|
||||||
inline constexpr FutexWaitableNoVTblMovable()
|
AURT_WAITABLE_NULL_CTORS_DEF(FutexWaitableNoVTblMovable)
|
||||||
{}
|
|
||||||
AU_MOVE(FutexWaitableNoVTblMovable)
|
|
||||||
inline constexpr FutexWaitableNoVTblMovable(const FutexWaitableNoVTblMovable &that)
|
|
||||||
{
|
|
||||||
// NOP
|
|
||||||
}
|
|
||||||
AU_OPERATOR_COPY(FutexWaitableNoVTblMovable)
|
|
||||||
|
|
||||||
inline bool TryLockNoSpin()
|
inline bool TryLockNoSpin()
|
||||||
{
|
{
|
||||||
@ -296,13 +283,7 @@ namespace Aurora::Threading::Waitables
|
|||||||
|
|
||||||
struct FutexWaitableNoVTblMovableSmallest final
|
struct FutexWaitableNoVTblMovableSmallest final
|
||||||
{
|
{
|
||||||
//AU_COPY_MOVE_DEF(FutexWaitableNoVTblMovableSmallest);
|
AURT_WAITABLE_NULL_CTORS_DEF(FutexWaitableNoVTblMovableSmallest)
|
||||||
AU_MOVE(FutexWaitableNoVTblMovableSmallest) AU_DEF(FutexWaitableNoVTblMovableSmallest)
|
|
||||||
inline FutexWaitableNoVTblMovableSmallest(const FutexWaitableNoVTblMovableSmallest &that)
|
|
||||||
{
|
|
||||||
// NOP
|
|
||||||
}
|
|
||||||
AU_OPERATOR_COPY(FutexWaitableNoVTblMovableSmallest)
|
|
||||||
|
|
||||||
inline bool TryLockNoSpin()
|
inline bool TryLockNoSpin()
|
||||||
{
|
{
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
***/
|
***/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "_.inl"
|
||||||
#include "CBWaitable.hpp"
|
#include "CBWaitable.hpp"
|
||||||
#include "BooleanWaitable.hpp"
|
#include "BooleanWaitable.hpp"
|
||||||
#include "FutexWaitable.hpp"
|
#include "FutexWaitable.hpp"
|
||||||
|
20
Include/Aurora/Threading/Waitables/_.inl
Normal file
20
Include/Aurora/Threading/Waitables/_.inl
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#define AURT_WAITABLE_NULL_CTORS(Type) \
|
||||||
|
inline constexpr Type(const Type &that) \
|
||||||
|
{ \
|
||||||
|
} \
|
||||||
|
inline constexpr Type(Type &&that) \
|
||||||
|
{ \
|
||||||
|
} \
|
||||||
|
AU_OPERATOR_COPY(Type) \
|
||||||
|
AU_OPERATOR_MOVE(Type)
|
||||||
|
|
||||||
|
#define AURT_WAITABLE_NULL_CTORS_DEF(Type) \
|
||||||
|
AURT_WAITABLE_NULL_CTORS(Type) \
|
||||||
|
inline constexpr Type() \
|
||||||
|
{ }
|
||||||
|
|
||||||
|
#define AURT_WAITABLE_COPY_OPERATORS(Type) \
|
||||||
|
AU_OPERATOR_COPY(Type) \
|
||||||
|
AU_OPERATOR_MOVE(Type)
|
Loading…
Reference in New Issue
Block a user