Skip to content

Commit cba3e94

Browse files
committed
Update some comments
1 parent c4f031b commit cba3e94

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

src/coreclr/nativeaot/Runtime/wasm/PalRedhawkWasm.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ void PalGetMaximumStackBounds_MultiThreadedWasm(void** ppStackLowOut, void** ppS
224224
}
225225

226226
#ifdef TARGET_WASI
227-
// No-op stubs that assume a single-threaded environment.
227+
// TODO-LLVM: No-op stubs, maybe when threads are implemented in WASI, we wont have to provide all of these.
228228
int pthread_mutex_init(pthread_mutex_t *, const pthread_mutexattr_t *)
229229
{
230230
return 0;
@@ -292,7 +292,7 @@ pthread_t pthread_self(void)
292292

293293
int pthread_equal(pthread_t, pthread_t)
294294
{
295-
return 1; // only one thread
295+
return 1;
296296
}
297297

298298
int pthread_attr_init(pthread_attr_t *)
@@ -322,10 +322,7 @@ int pthread_attr_setdetachstate(pthread_attr_t *, int)
322322

323323
using Dtor = void(*)(void*);
324324

325-
// Due to a bug in the toolchain, we have to provide an implementation of thread-local destruction.
326-
// Since this is the single-threaded case, we simply delegate to the static destruction mechanism.
327-
// Reference: https://github.com/llvm/llvm-project/blob/main/libcxxabi/src/cxa_thread_atexit.cpp.
328-
//
325+
// TODO=LLVM: This is a copy of the single threaded implementation.
329326
extern "C" int __cxa_thread_atexit(Dtor dtor, void* obj, void*)
330327
{
331328
struct DtorList

src/libraries/Common/src/Interop/Browser/Interop.Runtime.NativeAOT.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,9 @@ internal static unsafe partial class Runtime
2929
public static unsafe partial void CancelPromise(IntPtr gcHandle);
3030

3131
#if FEATURE_WASM_MANAGED_THREADS
32+
// Required by JavaScript/JSFunctionBinding.cs
3233
[LibraryImport(JSLibrary, EntryPoint = "mono_wasm_invoke_js_function_send")]
3334
public static unsafe partial void InvokeJSFunctionSend(nint targetNativeTID, nint functionHandle, nint data);
34-
[LibraryImport(JSLibrary, EntryPoint = "mono_wasm_install_js_worker_interop_wrapper")]
35-
public static unsafe partial void InstallWebWorkerInterop(nint proxyContextGCHandle, void* beforeSyncJSImport, void* afterSyncJSImport, void* pumpHandler);
36-
[LibraryImport(JSLibrary, EntryPoint = "mono_wasm_cancel_promise_post")]
37-
public static unsafe partial void CancelPromisePost(nint targetNativeTID, nint taskHolderGCHandle);
3835
[LibraryImport(JSLibrary, EntryPoint = "mono_wasm_invoke_jsimport_MT")]
3936
public static unsafe partial void InvokeJSImportSync(nint signature, nint args);
4037
[LibraryImport(JSLibrary, EntryPoint = "mono_wasm_invoke_jsimport_sync_send")]
@@ -43,10 +40,16 @@ internal static unsafe partial class Runtime
4340
public static unsafe partial void InvokeJSImportAsyncPost(nint targetNativeTID, nint signature, nint args);
4441
[LibraryImport(JSLibrary, EntryPoint = "mono_wasm_resolve_or_reject_promise_post")]
4542
public static unsafe partial void ResolveOrRejectPromisePost(nint targetNativeTID, nint data);
43+
[LibraryImport(JSLibrary, EntryPoint = "mono_wasm_install_js_worker_interop_wrapper")]
44+
public static unsafe partial void InstallWebWorkerInterop(nint proxyContextGCHandle, void* beforeSyncJSImport, void* afterSyncJSImport, void* pumpHandler);
45+
// Required by JavaScript/JSProxyContext.cs
4646
[LibraryImport(JSLibrary, EntryPoint = "mono_wasm_release_cs_owned_object_post")]
4747
internal static unsafe partial void ReleaseCSOwnedObjectPost(nint targetNativeTID, nint jsHandle);
4848
[LibraryImport(JSLibrary, EntryPoint = "mono_wasm_uninstall_js_worker_interop")]
4949
public static unsafe partial void UninstallWebWorkerInterop();
50+
// Required by JavaScript/CancelablePromise.cs
51+
[LibraryImport(JSLibrary, EntryPoint = "mono_wasm_cancel_promise_post")]
52+
public static unsafe partial void CancelPromisePost(nint targetNativeTID, nint taskHolderGCHandle);
5053
#endif
5154

5255
#region Not used by NativeAOT

src/mono/browser/runtime/loader/polyfills.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export function verifyEnvironment () {
2222
mono_assert(ENVIRONMENT_IS_SHELL || typeof globalThis.URL === "function", "This browser/engine doesn't support URL API. Please use a modern version. See also https://aka.ms/dotnet-wasm-features");
2323
mono_assert(typeof globalThis.BigInt64Array === "function", "This browser/engine doesn't support BigInt64Array API. Please use a modern version. See also https://aka.ms/dotnet-wasm-features");
2424
if (WasmEnableThreads) {
25+
// TODO-LLVM: Comment this check out for now so we can run at least some tests.
2526
//mono_assert(!ENVIRONMENT_IS_SHELL && !ENVIRONMENT_IS_NODE, "This build of dotnet is multi-threaded, it doesn't support shell environments like V8 or NodeJS. See also https://aka.ms/dotnet-wasm-features");
2627
mono_assert(globalThis.SharedArrayBuffer !== undefined, "SharedArrayBuffer is not enabled on this page. Please use a modern browser and set Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy http headers. See also https://aka.ms/dotnet-wasm-features");
2728
mono_assert(typeof globalThis.EventTarget === "function", "This browser/engine doesn't support EventTarget API. Please use a modern version. See also https://aka.ms/dotnet-wasm-features");

src/tests/Common/dirs.proj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<DisabledProjects Include="$(TestRoot)nativeaot\SmokeTests\HelloWasm\WasmDebugging.csproj" Condition="'$(TargetOS)' == 'browser' or '$(OS)' == 'Windows_NT' or '$(Configuration)' != 'Debug'" />
3131
<DisabledProjects Include="$(TestRoot)readytorun\**\*.csproj" Condition="'$(TestBuildMode)' == 'nativeaot'" />
3232

33+
<!-- TODO-LLVM: Reinstate when more thread support is implemented. -->
3334
<!-- WaitForPendingFinalizers fails, FinalizeFinalizableObjects is not implemented when WasmEnableThreads. -->
3435
<DisabledProjects Include="$(TestRoot)nativeaot\SmokeTests\DynamicGenerics\DynamicGenerics.csproj" Condition="'$(WasmEnableThreads)' == 'true'"/>
3536
<!-- Hangs attemping to create thread. -->

0 commit comments

Comments
 (0)