-
Notifications
You must be signed in to change notification settings - Fork 577
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/3.6.5' into releases
- Loading branch information
Showing
13 changed files
with
297 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Security; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace RazorEngine | ||
{ | ||
/// <summary> | ||
/// Helper for missing net40 methods, REMOVE me when we are net45 only. | ||
/// </summary> | ||
internal class TaskRunner | ||
{ | ||
/// <summary> | ||
/// Runs the given delegate in a new task (like Task.Run but works on net40). | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
/// <param name="t"></param> | ||
/// <returns></returns> | ||
public static Task<T> Run<T>(Func<T> t) | ||
{ | ||
#if NET40 | ||
var task = new Task<T>(t); | ||
task.Start(); | ||
return task; | ||
#else | ||
return Task.Run(t); | ||
#endif | ||
} | ||
|
||
/// <summary> | ||
/// Runs the given delegate in a new task (like Task.Run but works on net40). | ||
/// </summary> | ||
/// <param name="t"></param> | ||
/// <returns></returns> | ||
public static Task Run(Action t) | ||
{ | ||
#if NET40 | ||
var task = new Task(t); | ||
task.Start(); | ||
return task; | ||
#else | ||
return Task.Run(t); | ||
#endif | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.