summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/KernelKit/Semaphore.h
diff options
context:
space:
mode:
author0xf00sec <159052166+0xf00sec@users.noreply.github.com>2025-08-09 20:14:37 +0000
committerGitHub <noreply@github.com>2025-08-09 20:14:37 +0000
commitcfd80c4212d449c9b33cc9d18b05da6b3d2c52bc (patch)
tree77d15a66a6d600b72ddf69ff257a7692ed485ae5 /dev/kernel/KernelKit/Semaphore.h
parentd9f1a4f656ced76df3f23eeec678e1a3be1fd432 (diff)
parent7ada9006860084ba5d72b517649d1b2d51e4484a (diff)
Merge branch 'nekernel-org:dev' into dev
Diffstat (limited to 'dev/kernel/KernelKit/Semaphore.h')
-rw-r--r--dev/kernel/KernelKit/Semaphore.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/dev/kernel/KernelKit/Semaphore.h b/dev/kernel/KernelKit/Semaphore.h
index 930b245d..705d9f18 100644
--- a/dev/kernel/KernelKit/Semaphore.h
+++ b/dev/kernel/KernelKit/Semaphore.h
@@ -28,7 +28,7 @@ typedef UInt64 SemaphoreArr[kSemaphoreCount];
/// @brief Checks if the semaphore is valid.
inline BOOL rtl_sem_is_valid(const SemaphoreArr& sem, UInt64 owner = 0) {
- return sem[kSemaphoreOwnerIndex] == owner && sem[kSemaphoreCountIndex] >= 0;
+ return sem[kSemaphoreOwnerIndex] == owner && sem[kSemaphoreCountIndex] > 0;
}
/// @brief Releases the semaphore, resetting its owner and count.
@@ -61,7 +61,8 @@ inline BOOL rtl_sem_acquire(SemaphoreArr& sem, UInt64 owner) {
/// @param sem
/// @param timeout
/// @return
-inline BOOL rtl_sem_wait(SemaphoreArr& sem, UInt64 owner, UInt64 timeout, BOOL* condition = nullptr) {
+inline BOOL rtl_sem_wait(SemaphoreArr& sem, UInt64 owner, UInt64 timeout,
+ BOOL* condition = nullptr) {
if (!rtl_sem_is_valid(sem, owner)) {
return FALSE;
}