version 1.185, 2014/11/10 16:16:47
|
version 1.186, 2015/03/20 12:52:51
|
|
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
return; | return; |
} | } |
|
// Lock monitor mutex before executing the message because, as part of the |
|
// processing, HTTPConnection calls back to the monitor to set |
|
// status (monitor::setStatus(...). |
|
// See bug 10044 |
|
// monitor::setStatus() sets the monitor lock which, without this prior |
|
// monitor lock could result in a deadlock for HTTPConnection calls from |
|
// other threads. For example: |
|
// |
|
// monitor->_entriesLockMutex->dst->run-> httpConnection::run() |
|
// creates SocketMsg-> handleEnqueue-> _handleReadEvent-> |
|
// Monitor::setstate(...) |
|
// |
|
// CIMOperationResponseEncoder::sendResponse->handleEnqueue-> |
|
// _handleWriteEvent->(lock HTTPconnection->_closeConnection() |
|
// Monitor::setState->_entriesMutex -- Deadlock |
|
// |
|
// TODO: There may be a more efficient way to handle this interaction than |
|
// completely mutual exclusion of the monitor and HTTPConnection but this |
|
// does remove the chance of deadlock. Today we are not sure what the |
|
// effect would be of another way to handle the setState |
|
AutoMutex monitorLock(_monitor->getLock()); |
| |
AutoMutex connectionLock(_connection_mut); | AutoMutex connectionLock(_connection_mut); |
| |