Kernel: Stop using *LockRefPtr for TTY

TTY was only stored in Process::m_tty, so make that a SpinlockProtected.
This commit is contained in:
Andreas Kling 2023-04-04 07:47:21 +02:00
commit 1c77803845
Notes: sideshowbarker 2024-07-16 21:56:36 +09:00
6 changed files with 35 additions and 20 deletions

View file

@ -26,7 +26,7 @@ ErrorOr<NonnullRefPtr<OpenFileDescription>> SelfTTYDevice::open(int options)
if (!Process::has_current())
return Error::from_errno(ESRCH);
auto& current_process = Process::current();
LockRefPtr<TTY> tty = current_process.tty();
auto tty = current_process.tty();
if (!tty)
return Error::from_errno(ENXIO);
auto description = TRY(OpenFileDescription::try_create(*tty));