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:
parent
019ad8a507
commit
39ceefa5dd
4 changed files with 128 additions and 0 deletions
17
Kernel/Locking/NonnullRefContendedPtrVector.h
Normal file
17
Kernel/Locking/NonnullRefContendedPtrVector.h
Normal 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>;
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue