1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:48:12 +00:00

Way tighter locking in process creation.

We no longer disable interrupts around the whole affair.
Since MM manages per-process data structures, this works quite smoothly now.
Only procfs had to be tweaked with an InterruptDisabler.
This commit is contained in:
Andreas Kling 2018-11-01 14:41:49 +01:00
parent 52607aa086
commit 3a901ae36d
3 changed files with 40 additions and 25 deletions

View file

@ -116,7 +116,7 @@ ByteBuffer procfs$pid_exe(Process& process)
void ProcFileSystem::addProcess(Process& process)
{
ASSERT_INTERRUPTS_DISABLED();
InterruptDisabler disabler;
char buf[16];
ksprintf(buf, "%d", process.pid());
auto dir = addFile(createDirectory(buf));
@ -130,7 +130,7 @@ void ProcFileSystem::addProcess(Process& process)
void ProcFileSystem::removeProcess(Process& process)
{
ASSERT_INTERRUPTS_DISABLED();
InterruptDisabler disabler;
auto pid = process.pid();
auto it = m_pid2inode.find(pid);
ASSERT(it != m_pid2inode.end());