- Timestamp:
- Sep 13, 2014, 12:55:47 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/BlockingQueue.cs
r182 r190 7 7 public class BlockingQueue<T> 8 8 { 9 private bool closing = false; 9 10 private Queue<T> queue = new Queue<T> (); 10 11 … … 21 22 lock (queue) { 22 23 while (queue.Count == 0) { 24 if (closing) { 25 return default(T); 26 } 23 27 Monitor.Wait (queue); 24 28 } … … 27 31 } 28 32 33 public void Close () 34 { 35 lock (queue) { 36 closing = true; 37 Monitor.PulseAll (queue); 38 } 39 } 29 40 30 41 }
Note:
See TracChangeset
for help on using the changeset viewer.