1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-30 10:22:13 +00:00

Kernel: Switch process file descriptor table from spinlock to mutex

There's no reason for this to use a spinlock. Instead, let's allow
threads to block if someone else is using the descriptor table.
This commit is contained in:
Andreas Kling 2022-01-29 01:29:07 +01:00
parent 8ebec2938c
commit b56646e293
16 changed files with 37 additions and 37 deletions

View file

@ -26,7 +26,7 @@ ErrorOr<FlatPtr> Process::sys$create_inode_watcher(u32 flags)
if (flags & static_cast<unsigned>(InodeWatcherFlags::Nonblock))
description->set_blocking(false);
return m_fds.with([&](auto& fds) -> ErrorOr<FlatPtr> {
return m_fds.with_exclusive([&](auto& fds) -> ErrorOr<FlatPtr> {
fds[fd_allocation.fd].set(move(description));
if (flags & static_cast<unsigned>(InodeWatcherFlags::CloseOnExec))