Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
        /// <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));
 }
Ejemplo n.º 4
0
 protected sealed override XThread NewThread(IThreadFactory threadFactory)
 {
     return(threadFactory.NewThread(RunAction));
 }