Skip to content

Commit eb47bcb

Browse files
Stop tracking main thread event loop
1 parent 9c9ae1d commit eb47bcb

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

Sources/JavaScriptEventLoop/JavaScriptEventLoop.swift

-8
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ public final class JavaScriptEventLoop: SerialExecutor, @unchecked Sendable {
103103
}
104104

105105
private static var didInstallGlobalExecutor = false
106-
fileprivate static var _mainThreadEventLoop: JavaScriptEventLoop!
107-
fileprivate static var mainThreadEventLoop: JavaScriptEventLoop {
108-
return _mainThreadEventLoop
109-
}
110106

111107
/// Set JavaScript event loop based executor to be the global executor
112108
/// Note that this should be called before any of the jobs are created.
@@ -116,10 +112,6 @@ public final class JavaScriptEventLoop: SerialExecutor, @unchecked Sendable {
116112
public static func installGlobalExecutor() {
117113
guard !didInstallGlobalExecutor else { return }
118114

119-
// NOTE: We assume that this function is called before any of the jobs are created, so we can safely
120-
// assume that we are in the main thread.
121-
_mainThreadEventLoop = JavaScriptEventLoop.shared
122-
123115
#if compiler(>=5.9)
124116
typealias swift_task_asyncMainDrainQueue_hook_Fn = @convention(thin) (swift_task_asyncMainDrainQueue_original, swift_task_asyncMainDrainQueue_override) -> Void
125117
let swift_task_asyncMainDrainQueue_hook_impl: swift_task_asyncMainDrainQueue_hook_Fn = { _, _ in

0 commit comments

Comments
 (0)