public MonitorBasedSemaphore(int initial) { m = new StReentrantLock(); cv = new StConditionVariable(m); if (initial > 0) { permits = initial; } }
public MonitorBasedLinkedBlockingQueue(int capacity) { if (capacity <= 0) { throw new ArgumentException("capacity"); } this.capacity = capacity; buffer = new Queue <T>(capacity); m = new StReentrantLock(); cv = new StConditionVariable(m); }
public StConditionVariable(StReentrantLock mlock) : this((IMonitorLock)mlock) { }