|
@@ -356,7 +356,8 @@ namespace System.Threading.Tasks
|
|
|
status = TaskStatus.WaitingToRun;
|
|
status = TaskStatus.WaitingToRun;
|
|
|
|
|
|
|
|
// If worker is null it means it is a local one, revert to the old behavior
|
|
// If worker is null it means it is a local one, revert to the old behavior
|
|
|
- if (childWorkAdder == null || CheckTaskOptions (taskCreationOptions, TaskCreationOptions.PreferFairness)) {
|
|
|
|
|
|
|
+ // If TaskScheduler.Current is not being used, the scheduler was explicitly provided, so we must use that
|
|
|
|
|
+ if (scheduler != TaskScheduler.Current || childWorkAdder == null || CheckTaskOptions (taskCreationOptions, TaskCreationOptions.PreferFairness)) {
|
|
|
scheduler.QueueTask (this);
|
|
scheduler.QueueTask (this);
|
|
|
} else {
|
|
} else {
|
|
|
/* Like the semantic of the ABP paper describe it, we add ourselves to the bottom
|
|
/* Like the semantic of the ABP paper describe it, we add ourselves to the bottom
|