private LockWrapper(Lock @lock, UpdateLock managingLock, Logger logger) { this.@lock = @lock; if (_debugLocking) { if ([email protected]()) { logger.Log(Thread.CurrentThread + " may block on " + @lock + " of " + managingLock); while (!TryLockBlocking(@lock, managingLock, logger)) { logger.Log(Thread.CurrentThread + " still blocked on " + @lock + " of " + managingLock); } } } else { @lock.@lock(); } }
public static LockWrapper WriteLock(UpdateLock @lock, Logger logger) { return(new LockWrapper(@lock.writeLock(), @lock, logger)); }