public static void Init() { SingleThreadStarter.Init(); MainThreadWatchdog.Init(); MainThreadDispatcher.Init(); UnityActivityWatchdog.Init(); }
/// <summary> /// Starts an method running on a new thread. The Thread dies when the method has stopped running. /// You can now make use of the DispatchToMainThread-actions & WaitForNextFrame /// </summary> /// <param name="targetMethod">The method that will be executed by the new thread</param> /// <param name="argument">Object to pass to the targetMethod as soon as the Thread is started</param> /// <param name="priority">Thread Priority</param> /// <param name="safeMode">Default TRUE: Executes the targetMethod within a Try-Catch statement and will log any errors back to the MainThread</param> /// <returns>Newly instantiated Thread</returns> public static Thread StartSingleThread(ParameterizedThreadStart targetMethod, object argument, System.Threading.ThreadPriority priority = System.Threading.ThreadPriority.Normal, bool safeMode = true) { return(SingleThreadStarter.StartSingleThread(targetMethod, argument, priority, safeMode)); }
//--------------------------------------- 2 START SINGLE THREAD OVERLOADS -------------------------------------- //--------------------------------------- 2 START SINGLE THREAD OVERLOADS -------------------------------------- #region 2 START SINGLE THREAD OVERLOADS /// <summary> /// Starts an method running on a new thread. The Thread dies when the method has stopped running. /// You can now make use of the DispatchToMainThread-actions & WaitForNextFrame /// </summary> /// <param name="targetMethod">The method that will be executed by the new thread</param> /// <param name="priority">Thread Priority</param> /// <param name="safeMode">Default TRUE: Executes the targetMethod within a Try-Catch statement and will log any errors back to the MainThread</param> /// <returns>Newly instantiated Thread</returns> public static Thread StartSingleThread(ThreadStart targetMethod, System.Threading.ThreadPriority priority = System.Threading.ThreadPriority.Normal, bool safeMode = true) { return(SingleThreadStarter.StartSingleThread(targetMethod, priority, safeMode)); }
public static void AbortRunningThreads() { SingleThreadStarter.AbortRunningThreads(); }