From cf7df276ff22fc39f508736fbcb9b99a0befb17b Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Thu, 21 Jun 2001 22:44:38 +0000 Subject: [PATCH] fixed potential deadlock --- src/ca/tcpiiu.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/ca/tcpiiu.cpp b/src/ca/tcpiiu.cpp index 7c5be2f0c..2cafcd2ae 100644 --- a/src/ca/tcpiiu.cpp +++ b/src/ca/tcpiiu.cpp @@ -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 ();