Пример #1
0
 private object GetLockObject(string identifier)
 {
     lock (lockObjects)
     {
         LockObjectCount c;
         if (lockObjects.TryGetValue(identifier, out c))
         {
             c.Count++;
         }
         else
         {
             c = new LockObjectCount();
             lockObjects.Add(identifier, c);
         }
         return(c);
     }
 }
Пример #2
0
 private object GetLockObject(string identifier)
 {
     lock (lockObjects)
     {
         LockObjectCount c;
         if (lockObjects.TryGetValue(identifier, out c))
         {
             c.Count++;
         }
         else
         {
             c = new LockObjectCount();
             lockObjects.Add(identifier, c);
         }
         return c;
     }
 }