UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Chaos::TRwFifoLock< MutexType > Class Template Reference

#include <Threading.h>

Public Member Functions

 TRwFifoLock ()
 
 ~TRwFifoLock ()
 
void ReadLock ()
 
void WriteLock ()
 
void ReadUnlock ()
 
void WriteUnlock ()
 

Detailed Description

template<typename MutexType>
class Chaos::TRwFifoLock< MutexType >

A first-in, first-out "fair" read-write lock around a generic mutex Given a mutex (either just FCriticalSection or some custom lock) this class implements a fair lock. Any number of readers can enter the lock but as soon as a writer attempts to enter the lock all subsequent readers are forced to wait until the current readers leave the lock and the writer gets a chance to perform its operation. Once the write is completed the waiting readers are able to resume. This ensures we do not end up in a situation where we have a write waiting but many reads end up constantly forcing the write to wait. In a physics context a write on the game thread is time-critical and we want that thread to resume as soon as possible by pausing any reads (scene queries) until the write is finished

Constructor & Destructor Documentation

◆ TRwFifoLock()

template<typename MutexType >
Chaos::TRwFifoLock< MutexType >::TRwFifoLock ( )
inline

◆ ~TRwFifoLock()

template<typename MutexType >
Chaos::TRwFifoLock< MutexType >::~TRwFifoLock ( )
inline

Member Function Documentation

◆ ReadLock()

template<typename MutexType >
void Chaos::TRwFifoLock< MutexType >::ReadLock ( )
inline

◆ ReadUnlock()

template<typename MutexType >
void Chaos::TRwFifoLock< MutexType >::ReadUnlock ( )
inline

◆ WriteLock()

template<typename MutexType >
void Chaos::TRwFifoLock< MutexType >::WriteLock ( )
inline

◆ WriteUnlock()

template<typename MutexType >
void Chaos::TRwFifoLock< MutexType >::WriteUnlock ( )
inline

The documentation for this class was generated from the following file: