RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
SemaphoreGuard类 参考

An RAII lock/guard class for vrpn_Semaphore 更多...

#include <vrpn_Thread.h>

Public 成员函数

 SemaphoreGuard (vrpn_Semaphore &sem)
 Constructor that locks (p) the semaphore
 
 SemaphoreGuard (vrpn_Semaphore &sem, try_to_lock_t)
 overload that only tries to lock (condP) - doesn't block.
 
 ~SemaphoreGuard ()
 Destructor that unlocks if we've locked.
 
bool locked () const
 Checks to see if we locked.
 
void lock ()
 Locks the semaphore, if we haven't locked it already.
 
bool try_to_lock ()
 Tries to lock - returns true if we locked it.
 
void unlock ()
 Unlocks the resource, if we have locked it.
 

详细描述

An RAII lock/guard class for vrpn_Semaphore

构造及析构函数说明

◆ SemaphoreGuard() [1/2]

SemaphoreGuard ( vrpn_Semaphore & sem)
explicit

Constructor that locks (p) the semaphore

◆ SemaphoreGuard() [2/2]

overload that only tries to lock (condP) - doesn't block.

◆ ~SemaphoreGuard()

Destructor that unlocks if we've locked.

成员函数说明

◆ lock()

void lock ( )

Locks the semaphore, if we haven't locked it already.

◆ locked()

bool locked ( ) const
inline

Checks to see if we locked.

◆ try_to_lock()

bool try_to_lock ( )

Tries to lock - returns true if we locked it.

◆ unlock()

void unlock ( )

Unlocks the resource, if we have locked it.


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