Changeset 4712 for source/ariba/utility
- Timestamp:
- Jul 3, 2009, 10:34:24 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/utility/system/SystemQueue.cpp
r4704 r4712 141 141 // cause the thread to exit 142 142 { 143 // get the lock, when we got the lock the 144 // queue thread must be in itemsAvailable.wait() 143 145 boost::mutex::scoped_lock lock(queueMutex); 146 147 // set the running indicator and signal to run on 148 // this will run the thread and quit it 144 149 running = false; 145 146 while( eventsQueue.size() > 0 ){147 eventsQueue.erase( eventsQueue.begin() );148 }149 150 150 itemsAvailable.notify_all(); 151 151 } 152 152 153 // wait that the thread has exited 154 // and delete it, so that a subsuquent run() can be called 155 153 // wait until the thread has exited 156 154 queueThread->join(); 155 156 // delete pending events 157 while( eventsQueue.size() > 0 ){ 158 eventsQueue.erase( eventsQueue.begin() ); 159 } 160 161 // delete the thread, so that a subsuquent run() can be called 157 162 delete queueThread; 158 163 queueThread = NULL; … … 193 198 // this and cause the thread to exit 194 199 195 while ( obj-> eventsQueue.empty() && obj->running){200 while ( obj->running && obj->eventsQueue.empty() ){ 196 201 197 202 // const boost::system_time duration = 198 203 // boost::get_system_time() + 199 204 // boost::posix_time::milliseconds(100); 205 // obj->itemsAvailable.timed_wait( lock, duration ); 200 206 201 207 obj->itemsAvailable.wait( lock ); 202 // obj->itemsAvailable.timed_wait( lock, duration );203 208 } 204 209 … … 207 212 // 208 213 209 while( !obj->eventsQueue.empty() && obj->running) {214 while( obj->running && (!obj->eventsQueue.empty()) ) { 210 215 211 216 // fetch the first item in the queue
Note:
See TracChangeset
for help on using the changeset viewer.