internal override void FlagForDestruction(MonocleObject obj) { lock (_lock) { this.flaggedForDestruction.Enqueue(obj); } }
internal override void InitializeObject(MonocleObject toInitialize) { lock (_lock) { if (this.avalibleIDs.Count == 0) toInitialize.InstanceID = NextID++; else { toInitialize.InstanceID = avalibleIDs[avalibleIDs.Count - 1]; avalibleIDs.RemoveAt(avalibleIDs.Count - 1); } } }
internal override void InitializeObject(MonocleObject toInitialize) { lock (_lock) { if (this.avalibleIDs.Count == 0) { toInitialize.InstanceID = NextID++; } else { toInitialize.InstanceID = avalibleIDs[avalibleIDs.Count - 1]; avalibleIDs.RemoveAt(avalibleIDs.Count - 1); } } }
internal override void DestroyObject(MonocleObject toDestroy) { lock (_lock) { if (toDestroy.InstanceID == -1) return; toDestroy.DestroySelf(); long id = toDestroy.InstanceID; toDestroy.InstanceID = -1; if (id == NextID - 1) { NextID = id; return; } this.avalibleIDs.Add(id); } }
internal override void DestroyObject(MonocleObject toDestroy) { lock (_lock) { if (toDestroy.InstanceID == -1) { return; } toDestroy.DestroySelf(); long id = toDestroy.InstanceID; toDestroy.InstanceID = -1; if (id == NextID - 1) { NextID = id; return; } this.avalibleIDs.Add(id); } }
internal abstract void InitializeObject(MonocleObject obj);
internal abstract void FlagForDestruction(MonocleObject obj);
internal abstract void DestroyObject(MonocleObject monocleObject);