/// <summary> /// Start the given agent runner on a new thread. /// </summary> /// <param name="runner"> the agent runner to start </param> /// <param name="threadFactory"> the factory to use to create the thread.</param> /// <returns> the new thread that has been started.</returns> public static Thread StartOnThread(AgentRunner runner, IThreadFactory threadFactory) { var thread = threadFactory.NewThread(runner.Run); thread.Name = runner.Agent().RoleName(); thread.Start(); return(thread); }
/// <summary> /// Start the given agent runner on a new thread. /// </summary> /// <param name="runner"> the agent runner to start </param> /// <param name="threadFactory"> the factory to use to create the thread.</param> /// <returns> the new thread that has been started.</returns> public static Thread StartOnThread(AgentRunner runner, IThreadFactory threadFactory) { var thread = threadFactory.NewThread(runner.Run); ConfigureThread(thread, runner); thread.Start(); return(thread); }
protected virtual Thread NewThread(IThreadFactory threadFactory) { return(threadFactory.NewThread(_loopAction)); }
protected sealed override XThread NewThread(IThreadFactory threadFactory) { return(threadFactory.NewThread(RunAction)); }