version 1.70.2.1, 2003/08/08 17:39:38
|
version 1.70.2.2, 2003/08/08 20:05:41
|
|
|
void MessageQueueService::force_shutdown(void) | void MessageQueueService::force_shutdown(void) |
{ | { |
PEGASUS_STD(cout) << "Forcing shutdown of CIMOM Message Router" << PEGASUS_STD(endl); | PEGASUS_STD(cout) << "Forcing shutdown of CIMOM Message Router" << PEGASUS_STD(endl); |
MessageQueueService::_stop_polling = 1; |
//MessageQueueService::_stop_polling = 1; |
MessageQueueService *svc; | MessageQueueService *svc; |
|
int counter = 0; |
_polling_list.lock(); | _polling_list.lock(); |
svc = _polling_list.next(0); | svc = _polling_list.next(0); |
while(svc != 0) | while(svc != 0) |
|
|
DQueue<MessageQueueService> *list = reinterpret_cast<DQueue<MessageQueueService> *>(myself->get_parm()); | DQueue<MessageQueueService> *list = reinterpret_cast<DQueue<MessageQueueService> *>(myself->get_parm()); |
while ( _stop_polling.value() == 0 ) | while ( _stop_polling.value() == 0 ) |
{ | { |
|
counter++; |
_polling_sem.wait(); | _polling_sem.wait(); |
if(_stop_polling.value() != 0 ) | if(_stop_polling.value() != 0 ) |
{ | { |
break; | break; |
|
|
|
_polling_sem.signal(); |
|
|
|
while ( counter != 0) { |
|
Thread::sleep(100); |
|
_polling_list.lock(); |
|
svc = _polling_list.next(0); |
|
while (svc != 0 ) { |
|
if (svc ->_incoming_queue_shutdown.value() == 1 ) { |
|
counter--; |
|
} |
|
svc = _polling_list.next(svc); |
|
} |
|
_polling_list.unlock(); |
|
} |
|
MessageQueueService::_stop_polling = 1; |
} | } |
| |
list->lock(); | list->lock(); |
|
|
MessageQueueService *service = static_cast<MessageQueueService *>(req->op->_service_ptr); | MessageQueueService *service = static_cast<MessageQueueService *>(req->op->_service_ptr); |
| |
// respond to this message. | // respond to this message. |
_make_response(req, async_results::OK); |
// _make_response(req, async_results::OK); |
// ensure we do not accept any further messages | // ensure we do not accept any further messages |
| |
// ensure we don't recurse on IO_CLOSE | // ensure we don't recurse on IO_CLOSE |