[*] Linux clean up (?) (+typo)
This commit is contained in:
parent
eb95aeeac7
commit
9c86d1c899
@ -28,7 +28,7 @@
|
||||
* for the sake of porting modern applications. The aforementioned synchronization primitives
|
||||
* are written with OS specific optimizations in mind, and therefore consider emulation bloat.
|
||||
* bPreferEmulatedWakeOnAddress disables the emulation layer, if theres a reasonable native
|
||||
* interfaces available.
|
||||
* interface available.
|
||||
* Defer to ThreadingConfig::bPreferEmulatedWakeOnAddress = !AuBuild::kIsNtDerived
|
||||
***/
|
||||
#pragma once
|
||||
|
@ -7,9 +7,6 @@
|
||||
***/
|
||||
#include <Source/RuntimeInternal.hpp>
|
||||
#include "AuMutex.Generic.hpp"
|
||||
|
||||
#include <sys/syscall.h>
|
||||
#include <linux/futex.h>
|
||||
#include "SMTYield.hpp"
|
||||
|
||||
#if !defined(_AURUNTIME_GENERIC_MUTEX)
|
||||
@ -72,6 +69,20 @@ namespace Aurora::Threading::Primitives
|
||||
AuUInt64 uStart {};
|
||||
AuUInt64 uEnd {};
|
||||
|
||||
if (this->TryLockNoSpin())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
struct timespec tspec;
|
||||
if (uTimeout != 0)
|
||||
{
|
||||
uStart = AuTime::SteadyClockNS();
|
||||
uEnd = uStart + uTimeout;
|
||||
|
||||
Time::monoabsns2ts(&tspec, uEnd);
|
||||
}
|
||||
|
||||
if (ThrdCfg::gPreferLinuxPrimitivesFutexNoSpin)
|
||||
{
|
||||
if (this->TryLockNoSpin())
|
||||
@ -88,18 +99,6 @@ namespace Aurora::Threading::Primitives
|
||||
}
|
||||
|
||||
AuAtomicAdd(&this->dwSleeping_, 1u);
|
||||
|
||||
//redundant: 8.2.3.8
|
||||
//barrier();
|
||||
|
||||
struct timespec tspec;
|
||||
if (uTimeout != 0)
|
||||
{
|
||||
uStart = AuTime::SteadyClockNS();
|
||||
uEnd = uStart + uTimeout;
|
||||
|
||||
Time::monoabsns2ts(&tspec, uEnd);
|
||||
}
|
||||
|
||||
while (!this->TryLockNoSpin())
|
||||
{
|
||||
|
@ -180,11 +180,6 @@ namespace Aurora::Threading::Primitives
|
||||
Time::monoabsns2ts(&tspec, uEnd);
|
||||
}
|
||||
|
||||
if (this->TryLockHeavy())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
AuAtomicAdd<AuUInt32>(&this->dwSleeping_, 1u);
|
||||
|
||||
while (!this->TryLockNoSpin())
|
||||
|
Loading…
Reference in New Issue
Block a user