From 2b3a7ff02e349d36983d9c32c1de2b8f7b6e8da0 Mon Sep 17 00:00:00 2001 From: Rodrigo Kumpera Date: Tue, 27 Mar 2018 22:50:35 -0400 Subject: [wasm] Ignore TaskCreationOptions.LongRunning under WebAssembly as multiple-threads are not supported. --- .../src/System/Threading/Tasks/ThreadPoolTaskScheduler.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/System.Private.CoreLib/src/System/Threading/Tasks/ThreadPoolTaskScheduler.cs b/src/System.Private.CoreLib/src/System/Threading/Tasks/ThreadPoolTaskScheduler.cs index 7ac733a29..02c6e0ac3 100644 --- a/src/System.Private.CoreLib/src/System/Threading/Tasks/ThreadPoolTaskScheduler.cs +++ b/src/System.Private.CoreLib/src/System/Threading/Tasks/ThreadPoolTaskScheduler.cs @@ -48,7 +48,7 @@ namespace System.Threading.Tasks task.Id, creatingTask == null ? 0 : creatingTask.Id, (int)task.Options); } - +#if !WASM if ((task.Options & TaskCreationOptions.LongRunning) != 0) { // Run LongRunning tasks on their own dedicated thread. @@ -57,6 +57,8 @@ namespace System.Threading.Tasks thread.Start(task); } else +#endif + { // Normal handling for non-LongRunning tasks. bool forceToGlobalQueue = ((task.Options & TaskCreationOptions.PreferFairness) != 0); -- cgit v1.2.3