示例#1
0
 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();
     }
 }
示例#2
0
 public static LockWrapper WriteLock(UpdateLock @lock, Logger logger)
 {
     return(new LockWrapper(@lock.writeLock(), @lock, logger));
 }