Skip to content

Commit 58fb385

Browse files
committed
Kernel/TTY: Remove redundant SpinLock from VirtualConsole
VirtualConsole::m_lock was only used in a single place: on_tty_write() That function is already protected by a global lock, so this second lock served no purpose whatsoever.
1 parent b5b67a1 commit 58fb385

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

Kernel/TTY/VirtualConsole.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ void VirtualConsole::on_key_pressed(KeyEvent event)
260260
KResultOr<size_t> VirtualConsole::on_tty_write(const UserOrKernelBuffer& data, size_t size)
261261
{
262262
ScopedSpinLock global_lock(ConsoleManagement::the().tty_write_lock());
263-
ScopedSpinLock lock(m_lock);
264263
auto result = data.read_buffered<512>(size, [&](u8 const* buffer, size_t buffer_bytes) {
265264
for (size_t i = 0; i < buffer_bytes; ++i)
266265
m_console_impl.on_input(buffer[i]);

Kernel/TTY/VirtualConsole.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
2+
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
33
* Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
44
*
55
* SPDX-License-Identifier: BSD-2-Clause
@@ -118,7 +118,6 @@ class VirtualConsole final : public TTY
118118
bool m_graphical { false };
119119

120120
String m_tty_name;
121-
RecursiveSpinLock m_lock;
122121

123122
private:
124123
void initialize();

0 commit comments

Comments
 (0)