version 1.144, 2008/09/17 05:57:05
|
version 1.145, 2008/09/17 18:47:22
|
|
|
_thread_pool = 0; | _thread_pool = 0; |
} | } |
} // mutex unlocks here | } // mutex unlocks here |
// Clean up in case there are extra stuff on the queue. |
|
while (_incoming.count()) |
// Clean up any extra stuff on the queue. |
{ |
AsyncOpNode* op = 0; |
try |
while ((op = _incoming.dequeue())) |
{ |
|
delete _incoming.dequeue(); |
|
} |
|
catch (const ListClosed&) |
|
{ | { |
// If the list is closed, there is nothing we can do. |
delete op; |
break; |
|
} |
|
} | } |
} | } |
| |
|
|
| |
msg->op->_op_dest = this; | msg->op->_op_dest = this; |
msg->op->_request.reset(msg); | msg->op->_request.reset(msg); |
try |
if (_incoming.enqueue(msg->op)) |
{ | { |
_incoming.enqueue(msg->op); |
|
_polling_sem.signal(); | _polling_sem.signal(); |
} | } |
catch (const ListClosed&) |
else |
{ | { |
// This means the queue has already been shut-down (happens when there | // This means the queue has already been shut-down (happens when there |
// are two AsyncIoctrl::IO_CLOSE messages generated and one got first | // are two AsyncIoctrl::IO_CLOSE messages generated and one got first |
|
|
// many operations may have been queued. | // many operations may have been queued. |
do | do |
{ | { |
try |
|
{ |
|
operation = service->_incoming.dequeue(); | operation = service->_incoming.dequeue(); |
} |
|
catch (ListClosed&) |
|
{ |
|
// ATTN: This appears to be a common loop exit path. |
|
//PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL2, |
|
// "Caught ListClosed exception. Exiting _req_proc."); |
|
break; |
|
} |
|
| |
if (operation) | if (operation) |
{ | { |
|
|
if ((rq != 0 && (true == messageOK(rq))) || | if ((rq != 0 && (true == messageOK(rq))) || |
(rp != 0 && (true == messageOK(rp))) && _die.get() == 0) | (rp != 0 && (true == messageOK(rp))) && _die.get() == 0) |
{ | { |
_incoming.enqueue(op); |
if (_incoming.enqueue(op)) |
|
{ |
_polling_sem.signal(); | _polling_sem.signal(); |
return true; | return true; |
} | } |
|
} |
return false; | return false; |
} | } |
| |