mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
75260bff92
A protected value is a variable with enforced locking semantics. The value is protected with a Mutex and can only be accessed through a Locked object that holds a MutexLocker to said Mutex. Therefore, the value itself cannot be accessed except through the proper locking mechanism, which enforces correct locking semantics. The Locked object has knowledge of shared and exclusive lock types and will only return const-correct references and pointers. This should help catch incorrect locking usage where a shared lock is acquired but the user then modifies the locked value. This is not a perfect solution because dereferencing the Locked object returns the value, so the caller could defeat the protected value semantics once it acquires a lock by keeping a pointer or a reference to the value around. Then again, this is C++ and we can't protect against malicious users from within the kernel anyways, but we can raise the threshold above "didn't pay attention". |
||
---|---|---|
.. | ||
ContendedResource.h | ||
Lockable.h | ||
LockMode.h | ||
Mutex.cpp | ||
Mutex.h | ||
NonnullRefContendedPtr.h | ||
NonnullRefContendedPtrVector.h | ||
ProtectedValue.h | ||
RefContendedPtr.h | ||
RefCountedContended.h | ||
SpinLock.h | ||
SpinLockProtectedValue.h | ||
SpinLockResource.h |