Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Stop tracking main thread event loop
  • Loading branch information
kateinoigakukun committed Jun 27, 2024
commit eb47bcbd93eed9e435e41d3ebf433126bc5507d4
8 changes: 0 additions & 8 deletions Sources/JavaScriptEventLoop/JavaScriptEventLoop.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,6 @@ public final class JavaScriptEventLoop: SerialExecutor, @unchecked Sendable {
}

private static var didInstallGlobalExecutor = false
fileprivate static var _mainThreadEventLoop: JavaScriptEventLoop!
fileprivate static var mainThreadEventLoop: JavaScriptEventLoop {
return _mainThreadEventLoop
}

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

// NOTE: We assume that this function is called before any of the jobs are created, so we can safely
// assume that we are in the main thread.
_mainThreadEventLoop = JavaScriptEventLoop.shared

#if compiler(>=5.9)
typealias swift_task_asyncMainDrainQueue_hook_Fn = @convention(thin) (swift_task_asyncMainDrainQueue_original, swift_task_asyncMainDrainQueue_override) -> Void
let swift_task_asyncMainDrainQueue_hook_impl: swift_task_asyncMainDrainQueue_hook_Fn = { _, _ in
Expand Down