예제 #1
0
 private void TrackRequest(Microsoft.ServiceBus.Channels.IRequestBase request)
 {
     lock (this.outstandingRequests)
     {
         base.ThrowIfDisposedOrNotOpen();
         this.outstandingRequests.Add(request);
     }
 }
예제 #2
0
 private void ReleaseRequest(Microsoft.ServiceBus.Channels.IRequestBase request)
 {
     lock (this.outstandingRequests)
     {
         this.outstandingRequests.Remove(request);
         if (this.outstandingRequests.Count == 0 && !this.closed && this.closedEvent != null)
         {
             this.closedEvent.Set();
         }
     }
 }
예제 #3
0
 private Microsoft.ServiceBus.Channels.IRequestBase[] CopyPendingRequests(bool createEventIfNecessary)
 {
     Microsoft.ServiceBus.Channels.IRequestBase[] requestBaseArray = null;
     lock (this.outstandingRequests)
     {
         if (this.outstandingRequests.Count > 0)
         {
             requestBaseArray = new Microsoft.ServiceBus.Channels.IRequestBase[this.outstandingRequests.Count];
             this.outstandingRequests.CopyTo(requestBaseArray);
             this.outstandingRequests.Clear();
             if (createEventIfNecessary && this.closedEvent == null)
             {
                 this.closedEvent = new ManualResetEvent(false);
             }
         }
     }
     return(requestBaseArray);
 }