summaryrefslogtreecommitdiff
path: root/Kernel/TTY/ConsoleManagement.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-08-19 20:53:40 +0200
committerAndreas Kling <kling@serenityos.org>2022-08-20 17:20:43 +0200
commit11eee67b8510767d76fb4793e3b62ac1793dd723 (patch)
tree8ce47a3813ce74bba56c60f62b29bdd6cdf287da /Kernel/TTY/ConsoleManagement.h
parente475263113387404e63cdc3666391934604eb6e7 (diff)
downloadserenity-11eee67b8510767d76fb4793e3b62ac1793dd723.zip
Kernel: Make self-contained locking smart pointers their own classes
Until now, our kernel has reimplemented a number of AK classes to provide automatic internal locking: - RefPtr - NonnullRefPtr - WeakPtr - Weakable This patch renames the Kernel classes so that they can coexist with the original AK classes: - RefPtr => LockRefPtr - NonnullRefPtr => NonnullLockRefPtr - WeakPtr => LockWeakPtr - Weakable => LockWeakable The goal here is to eventually get rid of the Lock* classes in favor of using external locking.
Diffstat (limited to 'Kernel/TTY/ConsoleManagement.h')
-rw-r--r--Kernel/TTY/ConsoleManagement.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/Kernel/TTY/ConsoleManagement.h b/Kernel/TTY/ConsoleManagement.h
index c2a79176a7..ed890d85a9 100644
--- a/Kernel/TTY/ConsoleManagement.h
+++ b/Kernel/TTY/ConsoleManagement.h
@@ -6,9 +6,9 @@
#pragma once
-#include <AK/NonnullRefPtr.h>
-#include <AK/NonnullRefPtrVector.h>
#include <AK/Types.h>
+#include <Kernel/Library/NonnullLockRefPtr.h>
+#include <Kernel/Library/NonnullLockRefPtrVector.h>
#include <Kernel/TTY/VirtualConsole.h>
namespace Kernel {
@@ -31,13 +31,13 @@ public:
void switch_to_debug() { switch_to(1); }
- NonnullRefPtr<VirtualConsole> first_tty() const { return m_consoles[0]; }
- NonnullRefPtr<VirtualConsole> debug_tty() const { return m_consoles[1]; }
+ NonnullLockRefPtr<VirtualConsole> first_tty() const { return m_consoles[0]; }
+ NonnullLockRefPtr<VirtualConsole> debug_tty() const { return m_consoles[1]; }
RecursiveSpinlock& tty_write_lock() { return m_tty_write_lock; }
private:
- NonnullRefPtrVector<VirtualConsole, s_max_virtual_consoles> m_consoles;
+ NonnullLockRefPtrVector<VirtualConsole, s_max_virtual_consoles> m_consoles;
VirtualConsole* m_active_console { nullptr };
Spinlock m_lock { LockRank::None };
RecursiveSpinlock m_tty_write_lock { LockRank::None };