internal WorkerActor GetLifeActor(Type compType) { LifeDic.TryGetValue(compType, out var lifeActor); lock (LifeDic) { LifeDic.TryGetValue(compType, out lifeActor); if (lifeActor == null) { lifeActor = new WorkerActor(); LifeDic[compType] = lifeActor; } } return(lifeActor); }
static WorkerActor GetLifeActor(long actorId) { lifeActorDic.TryGetValue(actorId, out var actor); lock (lifeActorDic) { lifeActorDic.TryGetValue(actorId, out actor); if (actor == null) { actor = new WorkerActor(); lifeActorDic[actorId] = actor; } } return(actor); }