Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/Misc
References
| Module | Core |
| Header | /Engine/Source/Runtime/Core/Public/Misc/MTTransactionallySafeAccessDetector.h |
| Include | #include "Misc/MTTransactionallySafeAccessDetector.h" |
Syntax
struct FRWTransactionallySafeAccessDetectorDefinition
Remarks
A version of FRWAccessDetector which also can be used in AutoRTFM transactions.
When methods are called outside of a closed transaction they will behave exactly the same as FRWAccessDetector.
When called from a closed transaction:
- The first call to AcquireWriteLock() will hold the internal write lock for the remaining duration of the transaction, even if the transaction calls ReleaseWriteLock(). This is done to guard against writes that would occur if the transaction were aborted. The transaction's use of the API remains unchanged, but unlocks and read locks are effectively no-ops and other threads will "see" a longer duration of the write lock.
- Each call to [Acquire|Release][Read|Write]Access is recorded as a pair of signed read and write counters so that the OnAbort and OnCommit handlers can restore or apply the read and write lock state, respectively.
Functions
| Type | Name | Description | |
|---|---|---|---|
| bool | Acquires read access, will check if there are any writers | ||
| bool | Acquires write access, will check if there are readers or other writers | ||
| bool | Releases read access, will check if there are any writers | ||
| bool | Releases write access, will check if there are readers or other writers |