21 #ifndef INCLUDE_OLA_THREAD_FUTUREPRIVATE_H_ 22 #define INCLUDE_OLA_THREAD_FUTUREPRIVATE_H_ 26 #include <ola/thread/Mutex.h> 48 unsigned int ref_count = 0;
51 ref_count = --m_ref_count;
58 bool IsComplete()
const {
63 const T& Get()
const {
68 m_condition.
Wait(&m_mutex);
72 void Set(
const T &t) {
76 OLA_FATAL <<
"Double call to FutureImpl::Set()";
86 mutable Mutex m_mutex;
88 unsigned int m_ref_count;
114 unsigned int ref_count = 0;
117 ref_count = --m_ref_count;
119 if (ref_count == 0) {
124 bool IsComplete()
const {
134 m_condition.Wait(&m_mutex);
141 OLA_FATAL <<
"Double call to FutureImpl::Set()";
146 m_condition.Broadcast();
150 mutable Mutex m_mutex;
152 unsigned int m_ref_count;
160 #endif // INCLUDE_OLA_THREAD_FUTUREPRIVATE_H_ Definition: FuturePrivate.h:32
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Creates dummy copy constructor and assignment operator declarations.
Definition: Macro.h:44
void Wait(Mutex *mutex)
Definition: Mutex.cpp:112
#define OLA_FATAL
Definition: Logging.h:67
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
void Broadcast()
Definition: Mutex.cpp:145
Header file for OLA Logging.
Definition: FuturePrivate.h:99