-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[browser][coreCLR] async main, thread pool, timers #120976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 20 commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
d114103
rebase
pavelsavara 4f633d3
wip
pavelsavara 27daa57
cleanup
pavelsavara 775afc3
cleanup
pavelsavara 53facd5
Update src/coreclr/vm/qcallentrypoints.cpp
pavelsavara 58b16dd
Update src/coreclr/vm/qcallentrypoints.cpp
pavelsavara 3f36576
Update src/coreclr/vm/assembly.cpp
pavelsavara f76d16c
Update src/coreclr/vm/assembly.cpp
pavelsavara c03375c
Update src/coreclr/vm/assembly.cpp
pavelsavara cfd23db
Update src/coreclr/vm/assembly.cpp
pavelsavara e823885
Update src/coreclr/vm/qcallentrypoints.cpp
pavelsavara 72fa2de
Update src/coreclr/vm/wasm/helpers.cpp
pavelsavara f533328
Update src/coreclr/vm/wasm/helpers.cpp
pavelsavara 7e95e6d
Update src/coreclr/vm/assembly.cpp
pavelsavara cebd055
Update src/coreclr/vm/assembly.cpp
pavelsavara 66f38f2
Update src/coreclr/vm/assembly.cpp
pavelsavara 7586670
Update src/coreclr/vm/assembly.cpp
pavelsavara bad0ec9
Update src/coreclr/vm/assembly.cpp
pavelsavara 748dcc3
Update src/coreclr/vm/assembly.cpp
pavelsavara 7803d72
feedback
pavelsavara e3e48c5
Merge branch 'main' into browser_async_main
pavelsavara 063a40c
wip
pavelsavara f6ce84a
Merge branch 'main' into browser_async_main
pavelsavara d20157a
feedback
pavelsavara f210f97
propagate exit code and exception for corerun
pavelsavara a3a4cd4
Merge branch 'main' into browser_async_main
pavelsavara 2bcffb1
fix browserhost
pavelsavara 409c2f1
fix
pavelsavara d85edbc
fix
pavelsavara e0e16a5
Update src/native/corehost/browserhost/host/host.ts
pavelsavara 0af8464
Update src/native/libs/System.Native.Browser/utils/strings.ts
pavelsavara 38c6ead
feedback
pavelsavara 2ad67c9
cleanup
pavelsavara f439d0c
Merge branch 'main' into browser_async_main
pavelsavara 1c23039
implement https://github.com/dotnet/runtime/issues/121046
pavelsavara 2f62f04
Update src/libraries/System.Private.CoreLib/src/System/Runtime/Compil…
pavelsavara e62473b
feedback
pavelsavara 6730a82
Update src/coreclr/vm/assembly.cpp
pavelsavara 9565dbb
feedback
pavelsavara 9ed35b1
Merge branch 'main' into browser_async_main
pavelsavara 55a5f6e
fix
pavelsavara 8383b8a
feedback
pavelsavara 6795541
Merge branch 'main' into browser_async_main
pavelsavara f54121f
GCPROTECT_BEGIN
pavelsavara 8e748fd
Merge branch 'main' into browser_async_main
pavelsavara cae9ae9
Update src/libraries/System.Private.CoreLib/src/System/Runtime/Compil…
pavelsavara efd3396
Update src/libraries/System.Private.CoreLib/src/System/Runtime/Compil…
pavelsavara 8cf4102
Update src/libraries/System.Private.CoreLib/src/System/Runtime/Compil…
pavelsavara ab944ff
Update src/coreclr/vm/assembly.cpp
pavelsavara 6ae68d6
Update src/coreclr/vm/assembly.cpp
pavelsavara ff4dbe0
doc feedback
pavelsavara 0a423d0
Merge branch 'main' into browser_async_main
pavelsavara 78bdb31
Update src/coreclr/vm/assembly.cpp
pavelsavara File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
57 changes: 57 additions & 0 deletions
57
...oreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.Browser.cs
This file contains hidden or 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,57 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.Diagnostics.CodeAnalysis; | ||
| using System.Runtime.CompilerServices; | ||
| using System.Runtime.InteropServices; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace System.Runtime.CompilerServices | ||
| { | ||
| public static partial class AsyncHelpers | ||
| { | ||
| [DynamicDependency(nameof(MainWrapper))] | ||
| [DynamicDependency(nameof(MainWrapperVoid))] | ||
| static AsyncHelpers() | ||
| { | ||
| } | ||
|
|
||
| private static void MainWrapper(object exitCodeTask) | ||
| { | ||
| var task = (Task<int>)exitCodeTask; | ||
| task.ContinueWith(t => | ||
| { | ||
| if (t.IsFaulted) | ||
| { | ||
| SystemJS_RejectMainPromise(t.Exception.Message); | ||
| } | ||
| else | ||
| { | ||
| SystemJS_ResolveMainPromise(t.Result); | ||
| } | ||
| }, TaskScheduler.Default); | ||
| } | ||
|
|
||
| private static void MainWrapperVoid(object exitCodeTask) | ||
| { | ||
| var task = (Task)exitCodeTask; | ||
| task.ContinueWith(t => | ||
| { | ||
| if (t.IsFaulted) | ||
| { | ||
| SystemJS_RejectMainPromise(t.Exception.Message); | ||
| } | ||
| else | ||
| { | ||
| SystemJS_ResolveMainPromise(0); | ||
| } | ||
| }, TaskScheduler.Default); | ||
| } | ||
|
|
||
| [LibraryImport(RuntimeHelpers.QCall)] | ||
| private static unsafe partial void SystemJS_RejectMainPromise([MarshalAs(UnmanagedType.LPWStr)] string pMessage); | ||
|
|
||
| [LibraryImport(RuntimeHelpers.QCall)] | ||
| private static partial void SystemJS_ResolveMainPromise(int exitCode); | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.