public PriorityQueueEnumerator(LPriorityQueue owner) { this.owner = owner; this.version = owner.version; head = owner.header; Reset(); }
/// <summary> /// Returns a synchronized wrapper of the specified PriorityQueue. /// </summary> /// <param name = "queue"> /// The PriorityQueue to synchronize. /// </param> /// <returns> /// A synchronized PriorityQueue. /// </returns> /// <exception cref = "ArgumentNullException"> /// If queue is null. /// </exception> public static LPriorityQueue Synchronized(LPriorityQueue queue) { #region Require if (queue == null) { throw new ArgumentNullException("queue"); } #endregion return(new SynchronizedPriorityQueue(queue)); }
public SynchronizedPriorityQueue(LPriorityQueue queue) { #region Require if (queue == null) { throw new ArgumentNullException("queue"); } #endregion this.queue = queue; root = queue.SyncRoot; }