summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/KernelKit/BinaryMutex.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-05-02 19:38:46 +0200
committerGitHub <noreply@github.com>2025-05-02 19:38:46 +0200
commit997be16e5ac9a68d54882ab69529815860d62955 (patch)
tree19d6129c2d776bb1edc5d4a7325e39ca176c3403 /dev/kernel/KernelKit/BinaryMutex.h
parent618104e74c195d7508a18450524f8ed7f9af8cc6 (diff)
parentb3b4b1ebdcd6adeac914869017c86d892b7a8ced (diff)
Merge pull request #28 from nekernel-org/dev
0.0.2
Diffstat (limited to 'dev/kernel/KernelKit/BinaryMutex.h')
-rw-r--r--dev/kernel/KernelKit/BinaryMutex.h52
1 files changed, 24 insertions, 28 deletions
diff --git a/dev/kernel/KernelKit/BinaryMutex.h b/dev/kernel/KernelKit/BinaryMutex.h
index 675396fd..a1cd5b7c 100644
--- a/dev/kernel/KernelKit/BinaryMutex.h
+++ b/dev/kernel/KernelKit/BinaryMutex.h
@@ -1,43 +1,39 @@
/* -------------------------------------------
- Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved.
+ Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved.
------------------------------------------- */
#pragma once
-#include <NewKit/Defines.h>
-#include <KernelKit/Timer.h>
#include <CompilerKit/CompilerKit.h>
+#include <KernelKit/Timer.h>
+#include <NewKit/Defines.h>
-namespace Kernel
-{
- class Process;
-
- typedef Process& UserProcessRef;
+namespace Kernel {
+class USER_PROCESS;
- /// @brief Access control class, which locks a task until one is done.
- class BinaryMutex final
- {
- public:
- explicit BinaryMutex() = default;
- ~BinaryMutex() = default;
+/// @brief Access control class, which locks a task until one is done.
+class BinaryMutex final {
+ public:
+ explicit BinaryMutex() = default;
+ ~BinaryMutex() = default;
- public:
- bool IsLocked() const;
- bool Unlock() noexcept;
+ public:
+ bool IsLocked() const;
+ bool Unlock() noexcept;
- public:
- BOOL WaitForProcess(const Int16& sec) noexcept;
+ public:
+ BOOL WaitForProcess(const Int16& sec) noexcept;
- public:
- bool Lock(Process& process);
- bool LockOrWait(Process& process, TimerInterface* timer);
+ public:
+ bool Lock(USER_PROCESS& process);
+ bool LockOrWait(USER_PROCESS& process, TimerInterface* timer);
- public:
- NE_COPY_DEFAULT(BinaryMutex)
+ public:
+ NE_COPY_DEFAULT(BinaryMutex)
- private:
- UserProcessRef fLockingProcess;
- };
-} // namespace Kernel
+ private:
+ USER_PROCESS& fLockingProcess;
+};
+} // namespace Kernel