version 1.166, 2009/05/19 09:21:52
|
version 1.166.2.1, 2009/11/18 14:00:32
|
|
|
{ | { |
service->_handle_incoming_operation(operation); | service->_handle_incoming_operation(operation); |
} | } |
} while (operation); |
} while (operation && !service->_incoming_queue_shutdown.get()); |
} | } |
catch (const Exception& e) | catch (const Exception& e) |
{ | { |
|
|
#endif | #endif |
// set the closing flag, don't accept any more messages | // set the closing flag, don't accept any more messages |
service->_incoming_queue_shutdown = 1; | service->_incoming_queue_shutdown = 1; |
|
//Wait until no more threads are running in the service except ourself. |
|
//Note that if we don't wait for all threads to terminate here, deletion |
|
//of this service later may destruct derived class members while still |
|
//running threads in this service trying to access them. |
|
while (service->_threads.get() > 1) |
|
{ |
|
Threads::yield(); |
|
Threads::sleep(50); |
|
} |
// respond to this message. this is fire and forget, so we | // respond to this message. this is fire and forget, so we |
// don't need to delete anything. | // don't need to delete anything. |
// this takes care of two problems that were being found | // this takes care of two problems that were being found |