예제 #1
0
 public void begin(int timeout)
 {
     lock (this)
     {
         if (terminated)
         {
             throw new InvalidOperationException("Timer already terminated");
         }
         callingThread = Thread.currentThread();
         deadline      = now() + timeout;
         notifyAll();
     }
 }
예제 #2
0
 public AlarmState()
 {
     callingThread = Thread.currentThread();
 }