mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 16:57:46 +00:00
Kernel/SMP: Make entering/leaving critical sections multi-processor safe
By making these functions static we close a window where we could get preempted after calling Processor::current() and move to another processor. Co-authored-by: Tom <tomut@yahoo.com>
This commit is contained in:
parent
369e3da6a2
commit
9babb92a4b
11 changed files with 82 additions and 53 deletions
|
@ -46,14 +46,14 @@ public:
|
|||
{
|
||||
VERIFY(m_valid);
|
||||
m_valid = false;
|
||||
Processor::current().leave_critical(m_prev_flags);
|
||||
Processor::leave_critical(m_prev_flags);
|
||||
}
|
||||
|
||||
void enter()
|
||||
{
|
||||
VERIFY(!m_valid);
|
||||
m_valid = true;
|
||||
Processor::current().enter_critical(m_prev_flags);
|
||||
Processor::enter_critical(m_prev_flags);
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue