We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ad796ea commit a732a0cCopy full SHA for a732a0c
Sources/JavaScriptEventLoop/WebWorkerTaskExecutor.swift
@@ -434,8 +434,14 @@ public final class WebWorkerTaskExecutor: TaskExecutor {
434
/// Install a global executor that forwards jobs from Web Worker threads to the main thread.
435
///
436
/// This function must be called once before using the Web Worker task executor.
437
- @MainActor
438
public static func installGlobalExecutor() {
+ MainActor.assumeIsolated {
439
+ installGlobalExecutorIsolated()
440
+ }
441
442
+
443
+ @MainActor
444
+ static func installGlobalExecutorIsolated() {
445
#if canImport(wasi_pthread) && compiler(>=6.1) && _runtime(_multithreaded)
446
// Ensure this function is called only once.
447
guard _mainThread == nil else { return }
0 commit comments