[*] 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:
Reece Wilson 2024-05-28 19:28:08 +01:00
parent 22136a8ae2
commit c3e898d53d
6 changed files with 39 additions and 37 deletions

View File

@ -12,6 +12,10 @@
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
{
inline constexpr FutexBarrier(AuUInt32 uExpectThreads) :

View File

@ -9,19 +9,13 @@
#include "../WakeOnAddress.hpp"
#include "../SpinTime.hpp"
#include "_.inl"
namespace Aurora::Threading::Waitables
{
struct FutexCondWaitable final
{
inline constexpr FutexCondWaitable()
{}
AU_MOVE(FutexCondWaitable)
inline constexpr FutexCondWaitable(const FutexCondWaitable &that)
{
// NOP
}
AU_OPERATOR_COPY(FutexCondWaitable)
AURT_WAITABLE_NULL_CTORS_DEF(FutexCondWaitable)
template <class T>
inline bool WaitNS(T pWaitable, AuUInt64 uRelativeNanoseconds)

View File

@ -9,6 +9,7 @@
#include "../WakeOnAddress.hpp"
#include "../SpinTime.hpp"
#include "_.inl"
namespace Aurora::Threading::Waitables
{
@ -16,12 +17,13 @@ namespace Aurora::Threading::Waitables
{
inline constexpr FutexSemaphoreWaitable()
{}
AU_MOVE(FutexSemaphoreWaitable)
inline constexpr FutexSemaphoreWaitable(const FutexSemaphoreWaitable &that)
{
// NOP
}
AU_OPERATOR_COPY(FutexSemaphoreWaitable)
inline constexpr FutexSemaphoreWaitable(const FutexSemaphoreWaitable & that) :
uAtomicState(that.uAtomicState)
{ }
inline constexpr FutexSemaphoreWaitable(FutexSemaphoreWaitable &&that) :
uAtomicState(that.uAtomicState)
{ }
AURT_WAITABLE_COPY_OPERATORS(FutexSemaphoreWaitable)
inline auline bool TryLockNoSpin()
{

View File

@ -9,19 +9,13 @@
#include "../WakeOnAddress.hpp"
#include "../SpinTime.hpp"
#include "_.inl"
namespace Aurora::Threading::Waitables
{
struct FutexWaitable final : IWaitable
{
inline constexpr FutexWaitable()
{}
AU_MOVE(FutexWaitable)
inline constexpr FutexWaitable(const FutexWaitable &that)
{
// NOP
}
AU_OPERATOR_COPY(FutexWaitable)
AURT_WAITABLE_NULL_CTORS_DEF(FutexWaitable)
inline bool TryLockNoSpin()
{
@ -160,14 +154,7 @@ namespace Aurora::Threading::Waitables
struct FutexWaitableNoVTblMovable final
{
inline constexpr FutexWaitableNoVTblMovable()
{}
AU_MOVE(FutexWaitableNoVTblMovable)
inline constexpr FutexWaitableNoVTblMovable(const FutexWaitableNoVTblMovable &that)
{
// NOP
}
AU_OPERATOR_COPY(FutexWaitableNoVTblMovable)
AURT_WAITABLE_NULL_CTORS_DEF(FutexWaitableNoVTblMovable)
inline bool TryLockNoSpin()
{
@ -296,13 +283,7 @@ namespace Aurora::Threading::Waitables
struct FutexWaitableNoVTblMovableSmallest final
{
//AU_COPY_MOVE_DEF(FutexWaitableNoVTblMovableSmallest);
AU_MOVE(FutexWaitableNoVTblMovableSmallest) AU_DEF(FutexWaitableNoVTblMovableSmallest)
inline FutexWaitableNoVTblMovableSmallest(const FutexWaitableNoVTblMovableSmallest &that)
{
// NOP
}
AU_OPERATOR_COPY(FutexWaitableNoVTblMovableSmallest)
AURT_WAITABLE_NULL_CTORS_DEF(FutexWaitableNoVTblMovableSmallest)
inline bool TryLockNoSpin()
{

View File

@ -7,6 +7,7 @@
***/
#pragma once
#include "_.inl"
#include "CBWaitable.hpp"
#include "BooleanWaitable.hpp"
#include "FutexWaitable.hpp"

View 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)