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()";
150 mutable Mutex m_mutex;
152 unsigned int m_ref_count;
160 #endif // INCLUDE_OLA_THREAD_FUTUREPRIVATE_H_