diff options
Diffstat (limited to 'dev/Kernel/src/Semaphore.cc')
| -rw-r--r-- | dev/Kernel/src/Semaphore.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/dev/Kernel/src/Semaphore.cc b/dev/Kernel/src/Semaphore.cc index b82efbfe..07434e75 100644 --- a/dev/Kernel/src/Semaphore.cc +++ b/dev/Kernel/src/Semaphore.cc @@ -10,16 +10,18 @@ namespace Kernel { /***********************************************************************************/ - /// @brief Unlocks process out of the semaphore. + /// @brief Unlocks the semaphore. /***********************************************************************************/ Bool Semaphore::Unlock() noexcept { if (fLockingProcess) - fLockingProcess = UserProcess(); - else - return No; + { + fLockingProcess = UserProcess(); + fLockingProcess.Status = ProcessStatusKind::kFrozen; + return Yes; + } - return Yes; + return No; } /***********************************************************************************/ @@ -40,7 +42,7 @@ namespace Kernel /***********************************************************************************/ Bool Semaphore::IsLocked() const { - return fLockingProcess; + return fLockingProcess->Status == ProcessStatusKind::kRunning; } /***********************************************************************************/ |
