Agito obviam astrum
public class Barrier{ public Barrier(int count) { Count = count; } public int Count{get; set;} public void Wait() { lock(this) { if (--Count > 0) { System.Threading.Monitor.Wait(this); } else { System.Threading.Monitor.PulseAll(this); } } }}
Post a Comment
No comments:
Post a Comment