From 8545c59cbaa763e26d408d20f5711b7f7494be1f Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Wed, 31 Jul 2024 12:01:31 +0100 Subject: [PATCH] [*] Amend: 5cafefae bad linux optimization (?) --- Source/IO/Loop/LSLocalSemaphore.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/Source/IO/Loop/LSLocalSemaphore.cpp b/Source/IO/Loop/LSLocalSemaphore.cpp index b223b693..abba2102 100644 --- a/Source/IO/Loop/LSLocalSemaphore.cpp +++ b/Source/IO/Loop/LSLocalSemaphore.cpp @@ -46,7 +46,6 @@ namespace Aurora::IO::Loop bool LSLocalSemaphore::OnTrigger(AuUInt handle) { auto bRet = this->TryTakeNoSpin(); - bool bTriggerLater = !bRet; while (true) { @@ -70,10 +69,11 @@ namespace Aurora::IO::Loop // Don't acknowledge? // Don't write into? // saves two syscalls for nothang + AuAtomicAdd(&this->uAtomicKernelSemaphore, 1u); } else if (uCount) { - AuAtomicAdd(&this->uAtomicKernelSemaphore, uCount - 1); + AuAtomicAdd(&this->uAtomicKernelSemaphore, uCount); LSSemaphore::AddMany(uCount - 1); } #else @@ -86,26 +86,17 @@ namespace Aurora::IO::Loop else { (void)LSSemaphore::OnTrigger(0); - bTriggerLater = false; } } else if (uOld || !bRet) { (void)LSSemaphore::OnTrigger(0); - bTriggerLater = false; } break; } } - #if 0 - if (bTriggerLater) - { - (void)LSSemaphore::OnTrigger(0); - } - #endif - return bRet; }