Changeset 9a4949 for src/Actions/ActionQueue.cpp
- Timestamp:
- Oct 23, 2014, 4:33:11 PM (10 years ago)
- Children:
- fff8fc
- Parents:
- 23b6cf
- git-author:
- Frederik Heber <heber@…> (09/03/14 17:21:08)
- git-committer:
- Frederik Heber <heber@…> (10/23/14 16:33:11)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/ActionQueue.cpp
r23b6cf r9a4949 67 67 lastActionOk(true), 68 68 run_thread_isIdle(true), 69 run_thread_running(false), 69 70 run_thread(boost::bind(&ActionQueue::run, this)) 70 71 #endif … … 156 157 void ActionQueue::run() 157 158 { 159 { 160 boost::lock_guard<boost::mutex> lock(mtx_run_thread_isIdle); 161 run_thread_running = true; 162 } 158 163 bool Interrupted = false; 159 164 do { … … 175 180 bool status = (CurrentAction != actionqueue.size()); 176 181 mtx_queue.unlock(); 177 while ( status) {182 while ((status) && (!Interrupted)) { 178 183 // boost::this_thread::disable_interruption di; 179 184 // access actionqueue, hence using mutex … … 228 233 // LOG(1, "DEBUG: End of ActionQueue's run() loop."); 229 234 } while (!Interrupted); 235 { 236 boost::lock_guard<boost::mutex> lock(mtx_run_thread_isIdle); 237 run_thread_running = false; 238 } 230 239 } 231 240 #endif … … 245 254 { 246 255 boost::unique_lock<boost::mutex> lock(mtx_run_thread_isIdle); 247 while(!run_thread_isIdle) 248 { 249 cond_idle.wait(lock); 250 } 256 if (run_thread_running) 257 while(!run_thread_isIdle) 258 { 259 cond_idle.wait(lock); 260 } 251 261 } 252 262 #endif
Note:
See TracChangeset
for help on using the changeset viewer.