From 09dd11ddf800898c00ecb04a65fb5cd10fb481fa Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 8 May 2024 12:32:41 +0200 Subject: MHR-23: :boom: changes, reworked project tree. Signed-off-by: Amlal El Mahrouss --- Private/KernelKit/LockDelegate.hpp | 64 -------------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 Private/KernelKit/LockDelegate.hpp (limited to 'Private/KernelKit/LockDelegate.hpp') diff --git a/Private/KernelKit/LockDelegate.hpp b/Private/KernelKit/LockDelegate.hpp deleted file mode 100644 index 5b135625..00000000 --- a/Private/KernelKit/LockDelegate.hpp +++ /dev/null @@ -1,64 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#pragma once - -#include -#include - -#define kLockDone (200U) /* job is done */ -#define kLockTimedOut (100U) /* job has timed out */ - -namespace NewOS -{ - /// @brief Lock condition pointer. - typedef Boolean* LockPtr; - - /// @brief Locking delegate class, hangs until limit. - /// @tparam N the amount of cycles to wait. - template - class LockDelegate final - { - public: - LockDelegate() = delete; - - public: - explicit LockDelegate(LockPtr expr) - { - auto spin = 0U; - - while (spin != N) - { - if (*expr) - { - fLockStatus | kLockDone; - break; - } - } - - if (spin == N) - fLockStatus | kLockTimedOut; - } - - ~LockDelegate() = default; - - LockDelegate& operator=(const LockDelegate&) = delete; - LockDelegate(const LockDelegate&) = delete; - - bool Done() - { - return fLockStatus[kLockDone] == kLockDone; - } - - bool HasTimedOut() - { - return fLockStatus[kLockTimedOut] != kLockTimedOut; - } - - private: - Atom fLockStatus; - }; -} // namespace NewOS -- cgit v1.2.3