WASM: Add an internal method to pump the threadpool (#38690)
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Thu, 2 Jul 2020 12:19:20 +0000 (14:19 +0200)
committerGitHub <noreply@github.com>
Thu, 2 Jul 2020 12:19:20 +0000 (14:19 +0200)
commitfbd5d66c75ddcb566865136676f6ad16ac82d1bd
tree35ee5471fd9bbff46da1a2e066d779c95653171d
parent267e2cbfe87f9b75f48384907d78f29ce2f09077
WASM: Add an internal method to pump the threadpool (#38690)

This can by used by the xharness xunit runner to make sure async tasks are executed.

We also need to tweak how `ThreadPoolTaskScheduler` handles `TaskCreationOptions.LongRunning` since the usual mode of starting a new thread doesn't work, instead we treat it like the option wasn't set and queue the task on the threadpool.
src/coreclr/src/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs
src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs
src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/ThreadPoolTaskScheduler.cs
src/mono/mono/mini/mini-wasm.c
src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj
src/mono/netcore/System.Private.CoreLib/src/System/Threading/Thread.Browser.Mono.cs [new file with mode: 0644]
src/mono/netcore/System.Private.CoreLib/src/System/Threading/Thread.UnixOrWindows.Mono.cs [new file with mode: 0644]
src/mono/netcore/System.Private.CoreLib/src/System/Threading/ThreadPool.Browser.Mono.cs