1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:17:46 +00:00

Kernel/TTY: Protect SlavePTY pointer with proper spinlock

Instead of using a LockRefPtr, we could easily use SpinlockProtected to
ensure proper locking of this pointer.
This commit is contained in:
Liav A 2023-07-08 14:41:00 +03:00 committed by Andrew Kaster
parent b55199c227
commit 82428e2a05
2 changed files with 50 additions and 34 deletions

View file

@ -43,7 +43,7 @@ private:
virtual ErrorOr<void> ioctl(OpenFileDescription&, unsigned request, Userspace<void*> arg) override;
virtual StringView class_name() const override { return "MasterPTY"sv; }
LockRefPtr<SlavePTY> m_slave;
SpinlockProtected<RefPtr<SlavePTY>, LockRank::None> m_slave;
unsigned m_index;
bool m_closed { false };
NonnullOwnPtr<DoubleBuffer> m_buffer;