Skip to content

Commit 9328d4b

Browse files
Merge pull request swiftwasm#261 from swiftwasm/yt/xcode16
2 parents 9229214 + ba37ea4 commit 9328d4b

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ jobs:
7676
strategy:
7777
matrix:
7878
include:
79-
- os: macos-13
80-
xcode: Xcode_14.3
8179
- os: macos-14
8280
xcode: Xcode_15.2
81+
- os: macos-15
82+
xcode: Xcode_16
8383
runs-on: ${{ matrix.os }}
8484
steps:
8585
- uses: actions/checkout@v4

Sources/JavaScriptEventLoop/JavaScriptEventLoop.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public final class JavaScriptEventLoop: SerialExecutor, @unchecked Sendable {
6161
return _shared
6262
}
6363

64-
#if compiler(>=6.0) && hasFeature(IsolatedAny2) && _runtime(_multithreaded)
64+
#if compiler(>=6.1) && _runtime(_multithreaded)
6565
// In multi-threaded environment, we have an event loop executor per
6666
// thread (per Web Worker). A job enqueued in one thread should be
6767
// executed in the same thread under this global executor.

Sources/JavaScriptEventLoop/WebWorkerTaskExecutor.swift

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if compiler(>=6.0) && hasFeature(IsolatedAny2) && _runtime(_multithreaded) // @_expose and @_extern are only available in Swift 6.0+
1+
#if compiler(>=6.1) && _runtime(_multithreaded) // @_expose and @_extern are only available in Swift 6.1+
22

33
import JavaScriptKit
44
import _CJavaScriptKit
@@ -274,6 +274,7 @@ public final class WebWorkerTaskExecutor: TaskExecutor {
274274
}
275275

276276
func start(timeout: Duration, checkInterval: Duration) async throws {
277+
#if canImport(wasi_pthread)
277278
class Context: @unchecked Sendable {
278279
let executor: WebWorkerTaskExecutor.Executor
279280
let worker: Worker
@@ -316,6 +317,9 @@ public final class WebWorkerTaskExecutor: TaskExecutor {
316317
} while tid == 0
317318
swjs_listen_message_from_worker_thread(tid)
318319
}
320+
#else
321+
fatalError("Unsupported platform")
322+
#endif
319323
}
320324

321325
func terminate() {
@@ -420,6 +424,7 @@ public final class WebWorkerTaskExecutor: TaskExecutor {
420424
///
421425
/// This function must be called once before using the Web Worker task executor.
422426
public static func installGlobalExecutor() {
427+
#if canImport(wasi_pthread)
423428
// Ensure this function is called only once.
424429
guard _mainThread == nil else { return }
425430

@@ -448,6 +453,9 @@ public final class WebWorkerTaskExecutor: TaskExecutor {
448453
}
449454
}
450455
swift_task_enqueueGlobal_hook = unsafeBitCast(swift_task_enqueueGlobal_hook_impl, to: UnsafeMutableRawPointer?.self)
456+
#else
457+
fatalError("Unsupported platform")
458+
#endif
451459
}
452460
}
453461

Tests/JavaScriptEventLoopTests/WebWorkerTaskExecutorTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if compiler(>=6.0) && hasFeature(IsolatedAny2) && _runtime(_multithreaded)
1+
#if compiler(>=6.1) && _runtime(_multithreaded)
22
import XCTest
33
import JavaScriptKit
44
import _CJavaScriptKit // For swjs_get_worker_thread_id

0 commit comments

Comments
 (0)