Exemplo n.º 1
0
 /// <summary>
 /// Dispatch an action to be executed with a new, dedicated backgrouns thread.
 /// </summary>
 /// <typeparam name="T">Type of result value produced by action.</typeparam>
 /// <param name="handler">Action to enqueue for execution.</param>
 /// <param name="result">The <see cref="Result{T}"/>instance to be returned by this method.</param>
 /// <returns>Synchronization handle for the action's execution.</returns>
 public static Result <T> ForkThread <T>(Func <T> handler, Result <T> result)
 {
     ForkThread(TaskEnv.Clone().MakeAction(handler, result));
     return(result);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Dispatch an action to be executed with a new, dedicated backgrouns thread.
 /// </summary>
 /// <param name="handler">Action to enqueue for execution.</param>
 /// <param name="result">The <see cref="Result"/>instance to be returned by this method.</param>
 /// <returns>Synchronization handle for the action's execution.</returns>
 public static Result ForkThread(Action handler, Result result)
 {
     ForkThread(TaskEnv.Clone().MakeAction(handler, result));
     return(result);
 }