public ThreadPoolHandler StartPool(ThreadPoolOptions threadPoolOptions) { ThreadPoolHandler threadPoolHandler = this.CreatePool(threadPoolOptions); foreach (var job in threadPoolOptions.Jobs) { threadPoolHandler.addJob(job); } threadPoolHandler.Start(); return(threadPoolHandler); }
public ThreadPoolHandler CreatePool(ThreadPoolOptions threadPoolOptions) { ThreadPoolHandler handler = new ThreadPoolHandler(threadPoolOptions); ThreadPoolHandler result = null; if (!_pool.ContainsKey(handler.PoolName)) { if (_pool.TryAdd(handler.PoolName, handler)) { result = handler; } } return(result); }