summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/poll.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-01-29 01:29:07 +0100
committerAndreas Kling <kling@serenityos.org>2022-01-29 02:17:09 +0100
commitb56646e2936c98a9b9ff89adbdd2e437ce218d92 (patch)
tree054666f9715fa1d05213e81c316ee18df8b398d5 /Kernel/Syscalls/poll.cpp
parent8ebec2938cd43d16655404ba86b20c73bfb724a7 (diff)
downloadserenity-b56646e2936c98a9b9ff89adbdd2e437ce218d92.zip
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.
Diffstat (limited to 'Kernel/Syscalls/poll.cpp')
-rw-r--r--Kernel/Syscalls/poll.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Syscalls/poll.cpp b/Kernel/Syscalls/poll.cpp
index 42cf36e005..a783b72f4d 100644
--- a/Kernel/Syscalls/poll.cpp
+++ b/Kernel/Syscalls/poll.cpp
@@ -49,7 +49,7 @@ ErrorOr<FlatPtr> Process::sys$poll(Userspace<const Syscall::SC_poll_params*> use
for (size_t i = 0; i < params.nfds; i++) {
auto& pfd = fds_copy[i];
- auto description = TRY(m_fds.with([&](auto& fds) { return fds.open_file_description(pfd.fd); }));
+ auto description = TRY(m_fds.with_shared([&](auto& fds) { return fds.open_file_description(pfd.fd); }));
BlockFlags block_flags = BlockFlags::Exception; // always want POLLERR, POLLHUP, POLLNVAL
if (pfd.events & POLLIN)
block_flags |= BlockFlags::Read;