You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
683 B
25 lines
683 B
#if NET20 || NET30 || NET35 || !NET_4_6 |
|
|
|
using System.Diagnostics.Contracts; |
|
|
|
namespace System.Threading.Tasks |
|
{ |
|
internal abstract class TaskContinuation |
|
{ |
|
internal abstract void Run(Task completedTask, bool canInlineContinuationTask); |
|
|
|
protected static void InlineIfPossibleOrElseQueue(Task task) |
|
{ |
|
Contract.Requires(task != null); |
|
var scheduler = task.ExecutingTaskScheduler; |
|
if (scheduler == null) |
|
{ |
|
Contract.Assert(false); |
|
throw new InvalidOperationException(); |
|
} |
|
task.Start(task.ExecutingTaskScheduler, true, false); |
|
} |
|
} |
|
} |
|
|
|
#endif |