public static TimedLock Lock(object o, int milliSeconds) { var timedLock = new TimedLock(o); if (!Monitor.TryEnter(o, milliSeconds)) { throw new LockTimeoutException(); } return(timedLock); }
public static TimedLock Lock(object o, int milliSeconds) { var timedLock = new TimedLock(o); if (!Monitor.TryEnter(o, milliSeconds)) { throw new LockTimeoutException(); } return timedLock; }