Esempio n. 1
0
		static void Entities_OnCloseAll()
		{
			MyAPIGateway.Entities.OnCloseAll -= Entities_OnCloseAll;
			myLogger = null;
			MainThread_ReleaseExclusive();
			Lock_MainThread = null;
			lock_RayCast = null;
		}
Esempio n. 2
0
        private void grid_OnClosing(IMyEntity obj)
        {
            IMyCubeGrid grid = obj as IMyCubeGrid;

            grid.OnBlockAdded   -= grid_OnBlockAdded;
            grid.OnBlockRemoved -= grid_OnBlockRemoved;
            grid.OnClosing      -= grid_OnClosing;
            if (lock_cellCache == null)
            {
                return;
            }
            using (lock_cellPositions.AcquireExclusiveUsing())
            {
                CellPositions = null;
                LargeDoors    = null;
            }
            lock_cellPositions = null;
            using (lock_cellCache.AcquireExclusiveUsing())
                CellCache.Remove(grid);
        }
Esempio n. 3
0
		private static void Entities_OnCloseAll()
		{
			MyAPIGateway.Entities.OnCloseAll -= Entities_OnCloseAll;
			s_logger = null;
			lock_getSurfPoint = null;
		}
Esempio n. 4
0
 public Enumerator(LockedDictionary <TKey, TValue> dictionary)
 {
     _enumerator = dictionary.Dictionary.Values.GetEnumerator();
     _lock       = dictionary.Lock;
     _lock.AcquireShared();
 }
Esempio n. 5
0
 public SharedLock(FastResourceLock toLock)
 {
     this.MyLock = toLock;
     this.MyLock.AcquireShared();
 }
Esempio n. 6
0
 public ExclusiveLock(FastResourceLock toLock)
 {
     this.MyLock = toLock;
     this.MyLock.AcquireExclusive();
 }
Esempio n. 7
0
 public static string GetStatus(this FastResourceLock fastLock)
 {
     return("Owned=" + fastLock.Owned + ", SharedOwners=" + fastLock.SharedOwners + ", ExclusiveWaiters=" + fastLock.ExclusiveWaiters + ", SharedWaiters=" + fastLock.SharedWaiters);
 }
Esempio n. 8
0
 private static void Entities_OnCloseAll()
 {
     MyAPIGateway.Entities.OnCloseAll -= Entities_OnCloseAll;
     CellCache      = null;
     lock_cellCache = null;
 }
Esempio n. 9
0
 private void grid_OnClosing(IMyEntity obj)
 {
     IMyCubeGrid grid = obj as IMyCubeGrid;
     grid.OnBlockAdded -= grid_OnBlockAdded;
     grid.OnBlockRemoved -= grid_OnBlockRemoved;
     grid.OnClosing -= grid_OnClosing;
     if (lock_cellCache == null)
         return;
     using (lock_cellPositions.AcquireExclusiveUsing())
         CellPositions = null;
     lock_cellPositions = null;
     using (lock_cellCache.AcquireExclusiveUsing())
         CellCache.Remove(grid);
 }
Esempio n. 10
0
 private static void Entities_OnCloseAll()
 {
     MyAPIGateway.Entities.OnCloseAll -= Entities_OnCloseAll;
     CellCache = null;
     lock_cellCache = null;
 }