public static ChoQueue <T> Synchronized(ChoQueue <T> queue, object syncObject) { ChoGuard.ArgumentNotNull(queue, "Queue"); ChoGuard.ArgumentNotNull(syncObject, "SyncObject"); return(new ChoQueue <T> .ChoSyncronizedQueue <T>(queue, syncObject)); }
public static ChoQueue <T> BlockingQueue(ChoQueue <T> queue, int size) { ChoGuard.ArgumentNotNull(queue, "Queue"); if (size <= 0) { throw new ArgumentException("Size must be positive."); } if (size < queue.Count) { throw new ArgumentException("Size must be greater than queue count."); } return(new ChoQueue <T> .ChoBlockingQueue <T>(queue, size)); }
internal ChoBlockingQueue(ChoQueue <T1> queue, int size) { this._queue = queue; this._size = size; this._barrier = new ChoBarrier(0, size); }
internal ChoBlockingQueue(ChoQueue <T1> queue) : this(queue, Int32.MaxValue) { }
internal ChoSyncronizedQueue(ChoQueue <T1> queue, object syncObject) { this._queue = queue; this._syncRoot = syncObject; }
internal ChoSyncronizedQueue(ChoQueue <T1> queue) : this(queue, queue.SyncRoot) { }
public static ChoQueue <T> BlockingQueue(ChoQueue <T> queue) { ChoGuard.ArgumentNotNull(queue, "Queue"); return(new ChoQueue <T> .ChoBlockingQueue <T>(queue)); }
public static ChoQueue <T> Synchronized(ChoQueue <T> queue) { ChoGuard.ArgumentNotNull(queue, "Queue"); return(new ChoQueue <T> .ChoSyncronizedQueue <T>(queue)); }