public void begin(int timeout) { lock (this) { if (terminated) throw new InvalidOperationException("Timer already terminated"); callingThread = WorkerThread.CurrentThread(); deadline = now() + timeout; notifyAll(); } }
public AlarmState() { callingThread = WorkerThread.CurrentThread(); }