1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:48:10 +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:
Jean-Baptiste Boric 2021-07-19 00:17:17 +02:00 committed by Andreas Kling
parent 019ad8a507
commit 39ceefa5dd
4 changed files with 128 additions and 0 deletions

View file

@ -0,0 +1,17 @@
/*
* Copyright (c) 2021, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/NonnullPtrVector.h>
#include <Kernel/Locking/NonnullRefContendedPtr.h>
namespace Kernel {
template<typename T, size_t inline_capacity = 0>
using NonnullRefContendedPtrVector = AK::NonnullPtrVector<NonnullRefContendedPtr<T>, inline_capacity>;
}