コード例 #1
0
        public static Task Run(Action action, ThreadPool tp = null)
        {
            Task t = new Task(action);

            t.RunAsync((tp == null) ? defaultThreadPool : tp);
            return(t);
        }
コード例 #2
0
ファイル: Task_TResult.cs プロジェクト: Kuiju/GetTrigger_Test
        public static Task <TResult> Run(Func <TResult> action)
        {
            Task <TResult> t = new Task <TResult>(action);

            t.RunAsync();
            return(t);
        }
コード例 #3
0
ファイル: Task_TResult.cs プロジェクト: Kuiju/GetTrigger_Test
        public static Task <TResult> Run(Func <TResult> action, ThreadPool tp = null)
        {
            Task <TResult> t = new Task <TResult>(action);

            t.RunAsync((tp == null) ? defaultThreadPool : tp);
            return(t);
        }
コード例 #4
0
        /// <summary>
        /// Queues the specified work to run on the ThreadPool and returns a Task handle for that work.
        /// </summary>
        /// <param name="action">The work to execute asynchronously</param>
        /// <returns>A Task that represents the work queued to execute in the ThreadPool.</returns>
        /// <exception cref="T:System.ArgumentNullException">
        /// The <paramref name="action"/> parameter was null.
        /// </exception>
        public static Task Run(Action action)
        {
            Task t = new Task(action);

            t.RunAsync();
            return(t);
        }
コード例 #5
0
ファイル: Task.cs プロジェクト: XuTenTen/MultiThreadComponent
        public static Task Run(Action action, ThreadPool tp= null)
        {
            Task t = new Task(action);
			t.RunAsync((tp == null) ? defaultThreadPool : tp);
            return t;
        }