Module |
|
Header |
/Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/Framework/BufferedData.h |
Include |
#include "Chaos/Framework/BufferedData.h" |
template<typename ResourceType>
class TChaosReadWriteResource
Lockable resource for use with chaos data. External threads should call GetRead and ReleaseRead on this object to lock it for read. When this is done the physics thread will not be allowed to swap the buffers so external reads are safe. Physics code can use GetWritable to get access to the write buffer, no locks are performed here as the lock is only required from the physics side when swapping the buffers. No external thread should ever attempt to swap the buffer. Only the owning thread
Name | Description | |
---|---|---|
|
TChaosReadWriteResource ( |
Name | Description | ||
---|---|---|---|
|
const Resour... |
GetRead() |
Gets the readable version of the resource |
|
const Resour... |
GetReadable() |
Gets the owning thread's const readable side of the buffer |
|
ResourceType... |
GetWritable() |
Gets the owning thread's writable side of the buffer |
|
ReleaseRead() |
Release read locks |
|
|
Swap() |
Swaps the read/write sides of the buffer safely so no readers are interrupted (grabs a write lock) |