[Kernel/Threading] Fix some kernel threading issues

- broken atomic exchange on linux
- spinlock release memory buffer
- race in thread suspension
- removed misleading volatile qualifiers
This commit is contained in:
Herman S.
2025-09-27 16:26:22 +09:00
parent c4bd0c3f33
commit 4f1394bbaa
4 changed files with 34 additions and 9 deletions

View File

@@ -83,8 +83,8 @@ class Fence {
std::mutex mutex_;
std::condition_variable cond_;
// Use the highest bit (sign bit) as the signal flag and the rest to count
// waiting threads.
volatile state_t_ signal_state_;
// waiting threads. Protected by mutex_.
state_t_ signal_state_;
};
// Returns the total number of logical processors in the host system.