mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:57:35 +00:00
Kernel: Implement contended, ref-counted resource framework
This is some syntaxic sugar to use a ContendedResource object with reference counting. This effectively dissociates merely holding a reference to an object and actually using the object in a way that requires locking it against concurrent use.
This commit is contained in:
parent
019ad8a507
commit
39ceefa5dd
4 changed files with 128 additions and 0 deletions
17
Kernel/Locking/NonnullRefContendedPtr.h
Normal file
17
Kernel/Locking/NonnullRefContendedPtr.h
Normal file
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* Copyright (c) 2021, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/NonnullRefPtr.h>
|
||||
#include <Kernel/Locking/RefCountedContended.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
template<typename T>
|
||||
using NonnullRefContendedPtr = NonnullRefPtr<RefCountedContended<T>>;
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue