engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
Chaos::TChaosReadWriteResource< ResourceType > 模板类 参考

Lockable resource for use with chaos data. 更多...

#include <BufferedData.h>

Public 成员函数

const ResourceType & GetRead () const
 Gets the readable version of the resource
 
const ResourceType & GetReadable () const
 Gets the owning thread's const readable side of the buffer
 
ResourceType & GetWritable ()
 Gets the owning thread's writable side of the buffer
 
void ReleaseRead () const
 Release read locks
 
void Swap ()
 Swaps the read/write sides of the buffer safely so no readers are interrupted (grabs a write lock)
 

详细描述

template<typename ResourceType>
class Chaos::TChaosReadWriteResource< ResourceType >

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


该类的文档由以下文件生成: