mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:48:12 +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
|
@ -14,7 +14,7 @@ using BlockFlags = Thread::FileBlocker::BlockFlags;
|
|||
|
||||
static ErrorOr<NonnullRefPtr<OpenFileDescription>> open_readable_file_description(auto& fds, int fd)
|
||||
{
|
||||
auto description = TRY(fds.with([&](auto& fds) { return fds.open_file_description(fd); }));
|
||||
auto description = TRY(fds.with_shared([&](auto& fds) { return fds.open_file_description(fd); }));
|
||||
if (!description->is_readable())
|
||||
return EBADF;
|
||||
if (description->is_directory())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue