Beispiel #1
0
 protected override void Dispose(DiskQueueSegmentDisposeBehaviour disposeBehaviour, bool isUserCall)
 {
     if (disposeBehaviour == DiskQueueSegmentDisposeBehaviour.Delete)
     {
         IsDeleted = true;
     }
 }
        /// <summary>
        /// Cleans-up resources
        /// </summary>
        /// <param name="disposeBehaviour">Flag indicating whether the segment can be removed from disk</param>
        /// <param name="isUserCall">Was called explicitly by user</param>
        protected override void Dispose(DiskQueueSegmentDisposeBehaviour disposeBehaviour, bool isUserCall)
        {
            if (!_isDisposed)
            {
                _isDisposed = true;

                _readStream.Dispose();
                _writeStream.Dispose();

                if (disposeBehaviour == DiskQueueSegmentDisposeBehaviour.Delete)
                {
                    Debug.Assert(this.Count == 0);
                    File.Delete(_fileName);
                }
            }
        }
        /// <summary>
        /// Cleans-up resources
        /// </summary>
        /// <param name="disposeBehaviour">Flag indicating whether the segment can be removed from disk</param>
        /// <param name="isUserCall">Was called explicitly by user</param>
        protected override void Dispose(DiskQueueSegmentDisposeBehaviour disposeBehaviour, bool isUserCall)
        {
            if (!_isDisposed)
            {
                _isDisposed = true;

                _readStream.Dispose();
                _writeStream.Dispose();

                if (disposeBehaviour == DiskQueueSegmentDisposeBehaviour.Delete)
                {
                    TurboContract.Assert(this.Count == 0, conditionString: "this.Count == 0");
                    File.Delete(_fileName);
                }
            }
        }
Beispiel #4
0
 /// <summary>
 /// Cleans-up resources
 /// </summary>
 /// <param name="disposeBehaviour">Flag indicating whether the segment can be removed from disk</param>
 public void Dispose(DiskQueueSegmentDisposeBehaviour disposeBehaviour)
 {
     _entryCounter.TerminateAndWait();
     _segment.Dispose(disposeBehaviour);
 }
 /// <summary>
 /// Cleans-up resources
 /// </summary>
 /// <param name="disposeBehaviour">Flag indicating whether the segment can be removed from disk</param>
 /// <param name="isUserCall">Was called explicitly by user</param>
 protected override void Dispose(DiskQueueSegmentDisposeBehaviour disposeBehaviour, bool isUserCall)
 {
     _isDisposed = true;
 }
Beispiel #6
0
 /// <summary>
 /// Cleans-up resources
 /// </summary>
 /// <param name="disposeBehaviour">Flag indicating whether the segment can be removed from disk</param>
 public void Dispose(DiskQueueSegmentDisposeBehaviour disposeBehaviour)
 {
     Dispose(disposeBehaviour, true);
     GC.SuppressFinalize(this);
 }
Beispiel #7
0
 /// <summary>
 /// Cleans-up resources
 /// </summary>
 /// <param name="disposeBehaviour">Flag indicating whether the segment can be removed from disk</param>
 /// <param name="isUserCall">Was called explicitly by user</param>
 protected abstract void Dispose(DiskQueueSegmentDisposeBehaviour disposeBehaviour, bool isUserCall);