forked from Bananymous/banan-os
Kernel: Process now locks the mutex while modifying open files
This allows processes to be actually removed from the list instead of dead locking
This commit is contained in:
parent
8d6db168d6
commit
bdaf7cddcb
|
@ -52,10 +52,12 @@ namespace Kernel
|
||||||
}
|
}
|
||||||
|
|
||||||
void Process::exit()
|
void Process::exit()
|
||||||
|
{
|
||||||
{
|
{
|
||||||
LockGuard _(m_lock);
|
LockGuard _(m_lock);
|
||||||
for (auto* thread : m_threads)
|
for (auto* thread : m_threads)
|
||||||
thread->terminate();
|
thread->terminate();
|
||||||
|
}
|
||||||
while (!m_threads.empty())
|
while (!m_threads.empty())
|
||||||
PIT::sleep(1);
|
PIT::sleep(1);
|
||||||
for (auto& open_fd : m_open_files)
|
for (auto& open_fd : m_open_files)
|
||||||
|
|
Loading…
Reference in New Issue