mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:37:36 +00:00
Kernel: Fix some problems with Thread::wait_on and Lock
This changes the Thread::wait_on function to not enable interrupts upon leaving, which caused some problems with page fault handlers and in other situations. It may now be called from critical sections, with interrupts enabled or disabled, and returns to the same state. This also requires some fixes to Lock. To aid debugging, a new define LOCK_DEBUG is added that enables checking for Lock leaks upon finalization of a Thread.
This commit is contained in:
parent
9e32d79e02
commit
78f1b5e359
10 changed files with 178 additions and 83 deletions
|
@ -1052,14 +1052,6 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
void set_interrupt_flag_on_destruction(bool flag)
|
||||
{
|
||||
if (flag)
|
||||
m_prev_flags |= 0x200;
|
||||
else
|
||||
m_prev_flags &= ~0x200;
|
||||
}
|
||||
|
||||
void leave()
|
||||
{
|
||||
ASSERT(m_valid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue