Exemplo n.º 1
0
 public MyMonitor()
 {
     _enterCounter  = 0;
     _ownerThreadId = -1;
     _releaseSignal = new ManualResetEvent(false);
     _pulseSignal   = new ManualResetEvent(false);
     _lock          = new Spinlock();
 }
 public Semaphore(int max, int min = 0)
 {
     _counter  = max;
     _max      = max;
     _min      = min;
     _guard    = new AutoResetEvent();
     _spinlock = new Spinlock();
 }