Beispiel #1
0
 protected void _OnLockFailed(NetMutex mutex)
 {
     _reportedCount++;
     if (_reportedCount >= _mutexList.Count)
     {
         _Finalize();
     }
 }
Beispiel #2
0
 private void OnLockFailed(NetMutex mutex)
 {
     ++_reportedCount;
     if (_reportedCount < _mutexList.Count)
     {
         return;
     }
     FinalizeLocks();
 }
Beispiel #3
0
 protected void _OnLockAcquired(NetMutex mutex)
 {
     _reportedCount++;
     _acquiredLocks.Add(mutex);
     if (_reportedCount >= _mutexList.Count)
     {
         _Finalize();
     }
 }
Beispiel #4
0
 private void OnLockAcquired(NetMutex mutex)
 {
     ++_reportedCount;
     _acquiredLocks.Add(mutex);
     if (_reportedCount < _mutexList.Count)
     {
         return;
     }
     FinalizeLocks();
 }
Beispiel #5
0
 protected void _RequestMutexes()
 {
     if (_mutexList == null)
     {
         if (_onFailure != null)
         {
             _onFailure();
         }
         return;
     }
     if (_mutexList.Count == 0)
     {
         if (_onSuccess != null)
         {
             _onSuccess();
         }
         return;
     }
     for (int j = 0; j < _mutexList.Count; j++)
     {
         if (_mutexList[j].IsLocked())
         {
             if (_onFailure != null)
             {
                 _onFailure();
             }
             return;
         }
     }
     for (int i = 0; i < _mutexList.Count; i++)
     {
         NetMutex mutex = _mutexList[i];
         mutex.RequestLock(delegate
         {
             _OnLockAcquired(mutex);
         }, delegate
         {
             _OnLockFailed(mutex);
         });
     }
 }
Beispiel #6
0
 private void RequestMutexes()
 {
     if (_mutexList == null)
     {
         if (_onFailure == null)
         {
             return;
         }
         _onFailure();
     }
     else if (_mutexList.Count == 0)
     {
         if (_onSuccess == null)
         {
             return;
         }
         _onSuccess();
     }
     else
     {
         for (int index = 0; index < _mutexList.Count; ++index)
         {
             if (_mutexList[index].IsLocked())
             {
                 if (_onFailure == null)
                 {
                     return;
                 }
                 _onFailure();
                 return;
             }
         }
         for (int index = 0; index < _mutexList.Count; ++index)
         {
             NetMutex mutex = _mutexList[index];
             mutex.RequestLock((Action)(() => OnLockAcquired(mutex)), (Action)(() => OnLockFailed(mutex)));
         }
     }
 }