diff options
author | Andreas Kling <kling@serenityos.org> | 2022-08-19 20:53:40 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-08-20 17:20:43 +0200 |
commit | 11eee67b8510767d76fb4793e3b62ac1793dd723 (patch) | |
tree | 8ce47a3813ce74bba56c60f62b29bdd6cdf287da /Kernel/Graphics/VirtIOGPU/Console.cpp | |
parent | e475263113387404e63cdc3666391934604eb6e7 (diff) | |
download | serenity-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/Graphics/VirtIOGPU/Console.cpp')
-rw-r--r-- | Kernel/Graphics/VirtIOGPU/Console.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/Graphics/VirtIOGPU/Console.cpp b/Kernel/Graphics/VirtIOGPU/Console.cpp index 5d33a5c403..e2962fa858 100644 --- a/Kernel/Graphics/VirtIOGPU/Console.cpp +++ b/Kernel/Graphics/VirtIOGPU/Console.cpp @@ -11,10 +11,10 @@ namespace Kernel::Graphics::VirtIOGPU { constexpr static AK::Time refresh_interval = AK::Time::from_milliseconds(16); -NonnullRefPtr<Console> Console::initialize(VirtIODisplayConnector& parent_display_connector) +NonnullLockRefPtr<Console> Console::initialize(VirtIODisplayConnector& parent_display_connector) { auto current_resolution = parent_display_connector.current_mode_setting(); - return adopt_ref(*new Console(parent_display_connector, current_resolution)); + return adopt_lock_ref(*new Console(parent_display_connector, current_resolution)); } Console::Console(VirtIODisplayConnector const& parent_display_connector, DisplayConnector::ModeSetting current_resolution) @@ -36,7 +36,7 @@ void Console::flush(size_t, size_t, size_t, size_t) void Console::enqueue_refresh_timer() { - NonnullRefPtr<Timer> refresh_timer = adopt_ref(*new Timer()); + NonnullLockRefPtr<Timer> refresh_timer = adopt_lock_ref(*new Timer()); refresh_timer->setup(CLOCK_MONOTONIC, refresh_interval, [this]() { if (m_enabled.load() && m_dirty) { MUST(g_io_work->try_queue([this]() { |