1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:47:35 +00:00

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.
This commit is contained in:
Andreas Kling 2022-08-19 20:53:40 +02:00
parent e475263113
commit 11eee67b85
360 changed files with 1703 additions and 1672 deletions

View file

@ -11,10 +11,10 @@ namespace Kernel {
constexpr static AK::Time refresh_interval = AK::Time::from_milliseconds(16);
NonnullRefPtr<VMWareFramebufferConsole> VMWareFramebufferConsole::initialize(VMWareDisplayConnector& parent_display_connector)
NonnullLockRefPtr<VMWareFramebufferConsole> VMWareFramebufferConsole::initialize(VMWareDisplayConnector& parent_display_connector)
{
auto current_resolution = parent_display_connector.current_mode_setting();
return adopt_ref(*new (nothrow) VMWareFramebufferConsole(parent_display_connector, current_resolution));
return adopt_lock_ref(*new (nothrow) VMWareFramebufferConsole(parent_display_connector, current_resolution));
}
VMWareFramebufferConsole::VMWareFramebufferConsole(VMWareDisplayConnector const& parent_display_connector, DisplayConnector::ModeSetting current_resolution)
@ -39,7 +39,7 @@ void VMWareFramebufferConsole::flush(size_t, size_t, size_t, size_t)
void VMWareFramebufferConsole::enqueue_refresh_timer()
{
NonnullRefPtr<Timer> refresh_timer = adopt_ref(*new (nothrow) Timer());
NonnullLockRefPtr<Timer> refresh_timer = adopt_lock_ref(*new (nothrow) Timer());
refresh_timer->setup(CLOCK_MONOTONIC, refresh_interval, [this]() {
if (m_enabled.load() && m_dirty) {
MUST(g_io_work->try_queue([this]() {