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
|
@ -53,9 +53,11 @@ namespace Kernel
|
|||
|
||||
void Process::exit()
|
||||
{
|
||||
LockGuard _(m_lock);
|
||||
for (auto* thread : m_threads)
|
||||
thread->terminate();
|
||||
{
|
||||
LockGuard _(m_lock);
|
||||
for (auto* thread : m_threads)
|
||||
thread->terminate();
|
||||
}
|
||||
while (!m_threads.empty())
|
||||
PIT::sleep(1);
|
||||
for (auto& open_fd : m_open_files)
|
||||
|
|
Loading…
Reference in New Issue