internal void ClearMessagesInProgress()
{
if(inProgressClearRequiredFlag)
{
// Called from a thread in the ThreadPool, so we wait until we can
// get a lock on the unconsumed list then we clear it.
lock(this.unconsumedMessages)
{
if(inProgressClearRequiredFlag)
{
if(Tracer.IsDebugEnabled)
{
Tracer.Debug(this.ConsumerId + " clearing dispatched list (" +
this.unconsumedMessages.Count + ") on transport interrupt");
}
this.unconsumedMessages.Clear();
// allow dispatch on this connection to resume
this.session.Connection.TransportInterruptionProcessingComplete();
this.inProgressClearRequiredFlag = false;
}
}
}
}