using System;

namespace Hitsuji.Framework.Thread
{
    public class ThreadRunner
    {
        public static void doProcess(System.Collections.Hashtable parameters,
                                     Action<object> action,
                                     string threadName,
                                     bool isAsync)
        {
            if (!isAsync)
                action(parameters);
            else
            {
                var thread_ = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(action));
                thread_.IsBackground = true;
                thread_.Name = threadName;
                thread_.Start(parameters);
            }
        }
    }
}
