Ejemplo n.º 1
0
 internal void Unlock(Table obj)
 {
     if (obj.RowNo > 0)
     {
         RowLock lk;
         SyncWrite.WaitOne();
         if (LockList.TryGetValue(obj.RowNo, out lk))
         {
             if (lk.Own())
             {
                 if (lk.Unlock())
                 {
                     File.Unlock(obj);
                     LockList.Remove(obj.RowNo);
                     SyncWrite.ReleaseMutex();
                 }
                 return;
             }
         }
         SyncWrite.ReleaseMutex();
     }
     throw new System.InvalidOperationException("MinBase: Attempt to unlock an object which was not prevoiously locked at file " + File.LoFile.Name + ".");
 }