Kernel: Fix most of mutex + block race conditions
All block functions now take an optional mutex parameter that is atomically unlocked instead of having the user unlock it before hand. This prevents a ton of race conditions everywhere in the code!
This commit is contained in:
@@ -83,9 +83,7 @@ namespace Kernel
|
||||
{
|
||||
if (ns == 0)
|
||||
return;
|
||||
|
||||
const uint64_t wake_time_ns = ns_since_boot() + ns;
|
||||
Processor::scheduler().block_current_thread(nullptr, wake_time_ns);
|
||||
Processor::scheduler().block_current_thread(nullptr, ns_since_boot() + ns, nullptr);
|
||||
}
|
||||
|
||||
timespec SystemTimer::real_time() const
|
||||
|
||||
Reference in New Issue
Block a user