예제 #1
0
 /// <summary>
 ///
 /// </summary>
 /// throws ThreadInterruptedException.
 public void Clear()
 {
     AccessLock.WaitOne();
     try {
         Reset();
         NotFull.BroadcastCondition();
     } finally {
         AccessLock.ReleaseMutex();
     }
 }
예제 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="isOpen"></param>
 /// throws ThreadInterruptedException.
 public void SetState(bool isOpen)
 {
     AccessLock.WaitOne();
     try {
         IsOpen = isOpen;
         if (isOpen)
         {
             Ready.BroadcastCondition();
         }
     } finally {
         AccessLock.ReleaseMutex();
     }
 }
예제 #3
0
 /// <summary>
 /// Resets the collection.
 /// </summary>
 /// throws ThreadInterruptedException.
 public void Clear()
 {
     AccessLock.WaitOne();
     try {
         // Set each cell to null for gc.
         for (int k = 0; k < MaxCapacity; k++)
         {
             ContainerList[k] = default(T);
         }
         Head  = 0;
         Tail  = 0;
         Count = 0;
         NotFull.BroadcastCondition();
     } finally {
         AccessLock.ReleaseMutex();
     }
 }
예제 #4
0
 /**
  * Atomically removes all of the elements from this deque.
  * The deque will be empty after this call returns.
  * throws ThreadInterruptedException.
  */
 public void Clear()
 {
     AccessLock.WaitOne();
     try {
         for (Node <T> f = First; f != null;)
         {
             f.Item = Default;
             Node <T> n = f.Next;
             f.Prev = null;
             f.Next = null;
             f      = n;
         }
         First = Last = null;
         Count = 0;
         NotFull.BroadcastCondition();
     } finally {
         try {
             AccessLock.ReleaseMutex();
         } catch (Exception) {
             throw new ThreadInterruptedException();
         }
     }
 }