forked from Bananymous/banan-os
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:
@@ -269,7 +269,8 @@ namespace Kernel
|
||||
m_is_init_done = true;
|
||||
}
|
||||
|
||||
m_changed_port_blocker.block_with_timeout_ms(100);
|
||||
// FIXME: race condition
|
||||
m_changed_port_blocker.block_with_timeout_ms(100, nullptr);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -322,7 +322,8 @@ namespace Kernel
|
||||
m_ports_initialized = true;
|
||||
}
|
||||
|
||||
m_port_thread_blocker.block_with_timeout_ms(100);
|
||||
// FIXME: prevent race condition
|
||||
m_port_thread_blocker.block_with_timeout_ms(100, nullptr);
|
||||
expected = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user