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