@@ -2,10 +2,7 @@ import JavaScriptKit
2
2
import _Concurrency
3
3
import _CJavaScriptEventLoop
4
4
import _CJavaScriptKit
5
-
6
- #if hasFeature(Embedded)
7
5
import Synchronization
8
- #endif
9
6
10
7
// NOTE: `@available` annotations are semantically wrong, but they make it easier to develop applications targeting WebAssembly in Xcode.
11
8
@@ -109,12 +106,7 @@ public final class JavaScriptEventLoop: SerialExecutor, @unchecked Sendable {
109
106
return eventLoop
110
107
}
111
108
112
- #if !hasFeature(Embedded)
113
- @MainActor
114
- private static var didInstallGlobalExecutor = false
115
- #else
116
109
private static let didInstallGlobalExecutor = Atomic < Bool > ( false )
117
- #endif
118
110
119
111
/// Set JavaScript event loop based executor to be the global executor
120
112
/// Note that this should be called before any of the jobs are created.
@@ -135,13 +127,9 @@ public final class JavaScriptEventLoop: SerialExecutor, @unchecked Sendable {
135
127
@MainActor
136
128
#endif
137
129
private static func installGlobalExecutorIsolated( ) {
138
- #if !hasFeature(Embedded)
139
- guard !didInstallGlobalExecutor else { return }
140
- #else
141
130
guard !didInstallGlobalExecutor. load ( ordering: . sequentiallyConsistent) else {
142
131
return
143
132
}
144
- #endif
145
133
146
134
#if compiler(>=5.9)
147
135
typealias swift_task_asyncMainDrainQueue_hook_Fn = @convention ( thin) (
@@ -211,11 +199,7 @@ public final class JavaScriptEventLoop: SerialExecutor, @unchecked Sendable {
211
199
to: UnsafeMutableRawPointer ? . self
212
200
)
213
201
214
- #if !hasFeature(Embedded)
215
- didInstallGlobalExecutor = true
216
- #else
217
202
didInstallGlobalExecutor. store ( true , ordering: . sequentiallyConsistent)
218
- #endif
219
203
}
220
204
221
205
private func enqueue( _ job: UnownedJob , withDelay nanoseconds: UInt64 ) {
0 commit comments