LeviLamina
Loading...
Searching...
No Matches
SharedRecursiveMutexBase.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5namespace Bedrock::Threading {
6
7class SharedRecursiveMutexBase : public ::std::shared_mutex {
8public:
9 // member variables
10 // NOLINTBEGIN
11 ::ll::TypedStorage<4, 4, ::std::atomic<::std::thread::id>> mOwningThreadId;
12 ::ll::TypedStorage<4, 4, uint> mExclusiveLockCount;
13 ::ll::TypedStorage<8, 8, ::std::atomic<uint64>> mSharedLockCount;
14 // NOLINTEND
15
16public:
17 // virtual functions
18 // NOLINTBEGIN
19 virtual ~SharedRecursiveMutexBase() = default;
20
21 virtual bool _threadHoldsSharedLock(::std::thread::id) = 0;
22
23 virtual bool _shouldLockForSharedAccess(::std::thread::id) = 0;
24
25 virtual bool _shouldUnLockForSharedAccess(::std::thread::id) = 0;
26 // NOLINTEND
27};
28
29} // namespace Bedrock::Threading
Definition SharedRecursiveMutexBase.h:7