mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +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:
parent
8ebec2938c
commit
b56646e293
16 changed files with 37 additions and 37 deletions
|
@ -37,7 +37,7 @@ ErrorOr<FlatPtr> Process::sys$anon_create(size_t size, int options)
|
|||
if (options & O_CLOEXEC)
|
||||
fd_flags |= FD_CLOEXEC;
|
||||
|
||||
m_fds.with([&](auto& fds) { fds[new_fd.fd].set(move(description), fd_flags); });
|
||||
m_fds.with_exclusive([&](auto& fds) { fds[new_fd.fd].set(move(description), fd_flags); });
|
||||
return new_fd.fd;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue