Ejemplo n.º 1
0
		static void Entities_OnCloseAll()
		{
			MyAPIGateway.Entities.OnCloseAll -= Entities_OnCloseAll;
			myLogger = null;
			MainThread_ReleaseExclusive();
			Lock_MainThread = null;
			lock_RayCast = null;
		}
Ejemplo 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);
        }
Ejemplo n.º 3
0
		private static void Entities_OnCloseAll()
		{
			MyAPIGateway.Entities.OnCloseAll -= Entities_OnCloseAll;
			s_logger = null;
			lock_getSurfPoint = null;
		}
Ejemplo n.º 4
0
 public Enumerator(LockedDictionary <TKey, TValue> dictionary)
 {
     _enumerator = dictionary.Dictionary.Values.GetEnumerator();
     _lock       = dictionary.Lock;
     _lock.AcquireShared();
 }
Ejemplo n.º 5
0
 public SharedLock(FastResourceLock toLock)
 {
     this.MyLock = toLock;
     this.MyLock.AcquireShared();
 }
Ejemplo n.º 6
0
 public ExclusiveLock(FastResourceLock toLock)
 {
     this.MyLock = toLock;
     this.MyLock.AcquireExclusive();
 }
Ejemplo n.º 7
0
 public static string GetStatus(this FastResourceLock fastLock)
 {
     return("Owned=" + fastLock.Owned + ", SharedOwners=" + fastLock.SharedOwners + ", ExclusiveWaiters=" + fastLock.ExclusiveWaiters + ", SharedWaiters=" + fastLock.SharedWaiters);
 }
Ejemplo n.º 8
0
 private static void Entities_OnCloseAll()
 {
     MyAPIGateway.Entities.OnCloseAll -= Entities_OnCloseAll;
     CellCache      = null;
     lock_cellCache = null;
 }
Ejemplo 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);
 }
Ejemplo n.º 10
0
 private static void Entities_OnCloseAll()
 {
     MyAPIGateway.Entities.OnCloseAll -= Entities_OnCloseAll;
     CellCache = null;
     lock_cellCache = null;
 }