private void RegisterWithLifespanManager() { if (Bag == null) { lock (this) { if (Bag == null) { // if node.AgeBag==null then the object is not currently managed by LifespanMgr so add it Next = manager.AddToHead(this); } } } }
private void RegisterWithLifespanManager() { if (Bag == null) { lock (syncObject) { if (Bag == null) { // if Bag is null, then the object is not currently managed by the life span manager Next = manager.AddToHead(this); } } } }