fixed potential deadlock

This commit is contained in:
Jeff Hill
2001-06-21 22:44:38 +00:00
parent 3ac74dd5a8
commit cf7df276ff

View File

@@ -1232,10 +1232,6 @@ bool tcpiiu::flush ()
pBuf = this->sendQue.popNextComBufToSend ();
if ( pBuf ) {
this->unacknowledgedSendBytes += pBuf->occupiedBytes ();
if ( this->unacknowledgedSendBytes >
this->socketLibrarySendBufferSize ) {
this->recvDog.sendBacklogProgressNotify ();
}
}
else {
if ( this->blockingForFlush ) {
@@ -1246,6 +1242,17 @@ bool tcpiiu::flush ()
}
}
//
// we avoid calling this with the lock applied because
// it restarts the recv wd timer, this might block
// until a recv wd timer expire callback completes, and
// this callback takes the lock
//
if ( this->unacknowledgedSendBytes >
this->socketLibrarySendBufferSize ) {
this->recvDog.sendBacklogProgressNotify ();
}
bool success = pBuf->flushToWire ( *this );
pBuf->destroy ();