diff options
author | Andreas Kling <kling@serenityos.org> | 2022-02-02 23:44:46 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-03 16:11:26 +0100 |
commit | 248832f438e635853c596bb74f0613c69ec241e4 (patch) | |
tree | a0604bb4e9c781e038c62ab6fcccd3e4ea98e5cc /Kernel/TTY/PTYMultiplexer.h | |
parent | 35e24bc7742666e824afdd3276cdba9bd2574c1d (diff) | |
download | serenity-248832f438e635853c596bb74f0613c69ec241e4.zip |
Kernel: Convert OpenFileDescriptor from mutex to spinlock
A mutex is useful when we need to be able to block the current thread
until it's available. This is overkill for OpenFileDescriptor.
First off, this patch wraps the main state member variables inside a
SpinlockProtected<State> to enforce synchronized access. This also
avoids "free locking" where figuring out which variables are guarded
by which lock is left as an unamusing exercise for the reader.
Then we remove mutex locking from the functions that simply call through
to the underlying File or Inode, since those fields never change anyway,
and the target objects perform their own synchronization.
Diffstat (limited to 'Kernel/TTY/PTYMultiplexer.h')
0 files changed, 0 insertions, 0 deletions