#include <semaphore.hh>
|
| unsigned int | count |
| |
| boost::condition_variable | cond |
| |
| boost::mutex | mut |
| |
◆ Semaphore()
| Scroom::Semaphore::Semaphore |
( |
unsigned int |
count = 0 | ) |
|
|
inlineexplicit |
35 {
36 }
unsigned int count
Definition semaphore.hh:18
◆ P() [1/2]
| void Scroom::Semaphore::P |
( |
| ) |
|
|
inline |
39 {
40 boost::mutex::scoped_lock lock(
mut);
42 {
44 }
46 }
boost::condition_variable cond
Definition semaphore.hh:19
boost::mutex mut
Definition semaphore.hh:20
Referenced by WaitForAsyncOp::operator()(), and A::~A().
◆ P() [2/2]
template<typename duration_type >
| bool Scroom::Semaphore::P |
( |
duration_type const & |
rel_time | ) |
|
|
inline |
62 {
63 boost::posix_time::ptime const timeout = boost::posix_time::second_clock::universal_time() + rel_time;
64
65 boost::mutex::scoped_lock lock(
mut);
67 {
68 if(!
cond.timed_wait(lock, timeout))
69 {
70 return false;
71 }
72 }
74 return true;
75 }
◆ try_P()
| bool Scroom::Semaphore::try_P |
( |
| ) |
|
|
inline |
49 {
50 boost::mutex::scoped_lock
const lock(
mut);
52 {
54 return true;
55 }
56
57 return false;
58 }
◆ V()
| void Scroom::Semaphore::V |
( |
| ) |
|
|
inline |
◆ cond
| boost::condition_variable Scroom::Semaphore::cond |
|
private |
◆ count
| unsigned int Scroom::Semaphore::count |
|
private |
◆ mut
| boost::mutex Scroom::Semaphore::mut |
|
private |
The documentation for this class was generated from the following file: