43 void set(
const T &value)
58 template<
typename Key,
typename T,
typename Caller,
typename CallerData>
63 std::pair<Caller, CallerData>
caller;
66 template<
typename Key,
typename T,
typename Caller,
typename CallerData>
70 template<
typename Caller,
typename Data,
typename Key,
typename T>
78 template<
typename Key,
typename T,
typename Caller,
typename CallerData>
89 std::list<CallerInfo<Caller, CallerData, Key, T> >
callers;
99 template<
typename Key,
typename T,
typename Caller,
typename CallerData>
107 void add(
const Key &key, Caller caller, CallerData callerdata,
110 typename std::deque<GetRequest<Key, T, Caller, CallerData> >::iterator i;
111 typename std::list<CallerInfo<Caller, CallerData, Key, T> >::iterator j;
121 if (request.
key != key)
124 for (j = request.
callers.begin(); j != request.
callers.end(); ++j) {
126 if (ca.
caller == caller) {
127 ca.
data = callerdata;
134 ca.
data = callerdata;
149 ca.
data = callerdata;
180 ca.
dest->push_back(result);
ResultQueue< Key, T, Caller, Data > * dest
Definition: thread.h:75
Data data
Definition: thread.h:74
Caller caller
Definition: thread.h:73
std::list< CallerInfo< Caller, CallerData, Key, T > > callers
Definition: thread.h:89
Key key
Definition: thread.h:88
GetRequest(const Key &a_key)
Definition: thread.h:84
T item
Definition: thread.h:62
std::pair< Caller, CallerData > caller
Definition: thread.h:63
Key key
Definition: thread.h:61
Definition: container.h:126
bool empty() const
Definition: container.h:133
T pop_front(u32 wait_time_max_ms)
Definition: container.h:162
void push_back(T t)
Definition: container.h:139
std::mutex & getMutex()
Definition: container.h:227
std::deque< T > & getQueue()
Definition: container.h:229
T pop_frontNoEx(u32 wait_time_max_ms)
Definition: container.h:149
MutexedVariable(const T &value)
Definition: thread.h:33
T m_value
Definition: thread.h:50
std::mutex m_mutex
Definition: thread.h:52
void set(const T &value)
Definition: thread.h:43
T get()
Definition: thread.h:37
Notes for RequestQueue usage.
Definition: thread.h:100
GetRequest< Key, T, Caller, CallerData > pop()
Definition: thread.h:161
MutexedQueue< GetRequest< Key, T, Caller, CallerData > > m_queue
Definition: thread.h:185
bool empty()
Definition: thread.h:102
void add(const Key &key, Caller caller, CallerData callerdata, ResultQueue< Key, T, Caller, CallerData > *dest)
Definition: thread.h:107
void pushResult(GetRequest< Key, T, Caller, CallerData > req, T res)
Definition: thread.h:166
GetRequest< Key, T, Caller, CallerData > pop(unsigned int timeout_ms)
Definition: thread.h:156
Definition: semaphore.h:33
void post(unsigned int num=1)
Definition: semaphore.cpp:85
void wait()
Definition: semaphore.cpp:100
bool stop()
Definition: thread.cpp:136
bool stopRequested()
Definition: thread.h:91
virtual void doUpdate()=0
UpdateThread(const std::string &name)
Definition: thread.h:191
void * run()
Definition: thread.h:204
void deferUpdate()
Definition: thread.h:194
Semaphore m_update_sem
Definition: thread.h:227
void stop()
Definition: thread.h:196
#define END_DEBUG_EXCEPTION_HANDLER
Definition: debug.h:101
#define BEGIN_DEBUG_EXCEPTION_HANDLER
Definition: debug.h:100
std::unique_lock< std::mutex > MutexAutoLock
Definition: mutex_auto_lock.h:29