28 void set(
const T &value)
43template<
typename Key,
typename T,
typename Caller,
typename CallerData>
48 std::pair<Caller, CallerData>
caller;
51template<
typename Key,
typename T,
typename Caller,
typename CallerData>
55template<
typename Caller,
typename Data,
typename Key,
typename T>
63template<
typename Key,
typename T,
typename Caller,
typename CallerData>
74 std::list<CallerInfo<Caller, CallerData, Key, T> >
callers;
84template<
typename Key,
typename T,
typename Caller,
typename CallerData>
92 void add(
const Key &key, Caller caller, CallerData callerdata,
95 typename std::deque<GetRequest<Key, T, Caller, CallerData> >::iterator i;
96 typename std::list<CallerInfo<Caller, CallerData, Key, T> >::iterator j;
106 if (request.
key != key)
109 for (j = request.
callers.begin(); j != request.
callers.end(); ++j) {
111 if (ca.
caller == caller) {
112 ca.
data = callerdata;
119 ca.
data = callerdata;
134 ca.
data = callerdata;
ResultQueue< Key, T, Caller, Data > * dest
Definition thread.h:60
Data data
Definition thread.h:59
Caller caller
Definition thread.h:58
std::list< CallerInfo< Caller, CallerData, Key, T > > callers
Definition thread.h:74
Key key
Definition thread.h:73
GetRequest(const Key &a_key)
Definition thread.h:69
T item
Definition thread.h:47
std::pair< Caller, CallerData > caller
Definition thread.h:48
Key key
Definition thread.h:46
Definition container.h:117
bool empty() const
Definition container.h:124
T pop_front(u32 wait_time_max_ms)
Definition container.h:160
std::deque< T > & getQueue()
Definition container.h:227
T pop_frontNoEx(u32 wait_time_max_ms)
Definition container.h:147
void push_back(const T &t)
Definition container.h:130
std::mutex & getMutex()
Definition container.h:225
MutexedVariable(const T &value)
Definition thread.h:18
T m_value
Definition thread.h:35
std::mutex m_mutex
Definition thread.h:37
void set(const T &value)
Definition thread.h:28
T get()
Definition thread.h:22
Notes for RequestQueue usage.
Definition thread.h:85
MutexedQueue< GetRequest< Key, T, Caller, CallerData > > m_queue
Definition thread.h:170
bool empty()
Definition thread.h:87
GetRequest< Key, T, Caller, CallerData > pop()
Definition thread.h:146
GetRequest< Key, T, Caller, CallerData > pop(unsigned int timeout_ms)
Definition thread.h:141
void add(const Key &key, Caller caller, CallerData callerdata, ResultQueue< Key, T, Caller, CallerData > *dest)
Definition thread.h:92
void pushResult(GetRequest< Key, T, Caller, CallerData > req, T res)
Definition thread.h:151
Definition semaphore.h:18
void post(unsigned int num=1)
Definition semaphore.cpp:70
void wait()
Definition semaphore.cpp:85
bool stop()
Definition thread.cpp:140
bool stopRequested()
Definition thread.h:92
virtual void doUpdate()=0
UpdateThread(const std::string &name)
Definition thread.h:176
void deferUpdate()
Definition thread.h:179
Semaphore m_update_sem
Definition thread.h:212
void * run()
Definition thread.h:189
void stop()
Definition thread.h:181
#define END_DEBUG_EXCEPTION_HANDLER
Definition debug.h:78
#define BEGIN_DEBUG_EXCEPTION_HANDLER
Definition debug.h:77
std::lock_guard< std::mutex > MutexAutoLock
Definition mutex_auto_lock.h:31