Locking class.
More...
#include <Semaphore.h>
|
| Lock () |
| Default constructor which sees to it that it is released.
|
|
| Lock (const Semaphore &semaphore, const TimeSpec &timeout) |
| Constructor see acquire() function.
|
|
| Lock (const Semaphore &semaphore, bool tryWait=false) |
| Constructor.
|
|
| ~Lock () |
| Destructor cleaning up.
|
|
bool | acquire (const Semaphore &semaphore, const TimeSpec &timeout) |
| Waits to acquire the semaphore. Is called from the constructor. The timeout is the time the function will block. Use method isAcquired to check what the current status is.
|
|
bool | acquire (const Semaphore &semaphore, bool tryWait=false) |
| Waits to acquire the semaphore. Is also called from the constructor. When the 'tryWait' argument is true the method will not block but return immediately.
|
|
bool | isAcquired () const |
| See if semaphore was acquired or timed-out.
|
|
void | release (bool relinquish=true) |
| Releases.
|
|
◆ Lock() [1/3]
sf::Semaphore::Lock::Lock |
( |
| ) |
|
|
inline |
Default constructor which sees to it that it is released.
◆ Lock() [2/3]
Constructor see acquire() function.
- Parameters
-
semaphore | Semaphore to lock. |
timeout | Timeout to wait for a lock. |
◆ Lock() [3/3]
sf::Semaphore::Lock::Lock |
( |
const Semaphore & |
semaphore, |
|
|
bool |
tryWait = false |
|
) |
| |
|
inlineexplicit |
Constructor.
- See also
- acquire()
- Parameters
-
semaphore | Semaphore to lock. |
tryWait | When True the constructor is blocking. |
◆ ~Lock()
sf::Semaphore::Lock::~Lock |
( |
| ) |
|
|
inline |
◆ acquire() [1/2]
bool sf::Semaphore::Lock::acquire |
( |
const Semaphore & |
semaphore, |
|
|
bool |
tryWait = false |
|
) |
| |
Waits to acquire the semaphore. Is also called from the constructor. When the 'tryWait' argument is true the method will not block but return immediately.
- Parameters
-
semaphore | Semaphore to lock. |
tryWait | When True the function is blocking. |
- Returns
- True when acquired.
◆ acquire() [2/2]
bool sf::Semaphore::Lock::acquire |
( |
const Semaphore & |
semaphore, |
|
|
const TimeSpec & |
timeout |
|
) |
| |
Waits to acquire the semaphore. Is called from the constructor. The timeout is the time the function will block. Use method isAcquired to check what the current status is.
- Parameters
-
semaphore | Semaphore to lock. |
timeout | Timeout to wait for a lock. |
- Returns
- True when acquired.
◆ isAcquired()
bool sf::Semaphore::Lock::isAcquired |
( |
| ) |
const |
|
inline |
See if semaphore was acquired or timed-out.
- Returns
- True when acquired.
◆ release()
void sf::Semaphore::Lock::release |
( |
bool |
relinquish = true | ) |
|
Releases.
- Parameters
-
relinquish | True when this lock can acquire again. |
The documentation for this class was generated from the following file: