@@ -29,7 +29,7 @@ public class JSObject: Equatable {
29
29
@_spi ( JSObject_id)
30
30
public var id : JavaScriptObjectRef
31
31
32
- #if _runtime(_multithreaded)
32
+ #if compiler(>=6.1) && _runtime(_multithreaded)
33
33
private let ownerThread : pthread_t
34
34
#endif
35
35
@@ -47,14 +47,14 @@ public class JSObject: Equatable {
47
47
/// is a programmer error and will result in a runtime assertion failure because JavaScript
48
48
/// object spaces are not shared across threads backed by Web Workers.
49
49
private func assertOnOwnerThread( hint: @autoclosure ( ) -> String ) {
50
- #if _runtime(_multithreaded)
50
+ #if compiler(>=6.1) && _runtime(_multithreaded)
51
51
precondition ( pthread_equal ( ownerThread, pthread_self ( ) ) != 0 , " JSObject is being accessed from a thread other than the owner thread: \( hint ( ) ) " )
52
52
#endif
53
53
}
54
54
55
55
/// Asserts that the two objects being compared are owned by the same thread.
56
56
private static func assertSameOwnerThread( lhs: JSObject , rhs: JSObject , hint: @autoclosure ( ) -> String ) {
57
- #if _runtime(_multithreaded)
57
+ #if compiler(>=6.1) && _runtime(_multithreaded)
58
58
precondition ( pthread_equal ( lhs. ownerThread, rhs. ownerThread) != 0 , " JSObject is being accessed from a thread other than the owner thread: \( hint ( ) ) " )
59
59
#endif
60
60
}
@@ -206,7 +206,7 @@ public class JSObject: Equatable {
206
206
207
207
// `JSObject` storage itself is immutable, and use of `JSObject.global` from other
208
208
// threads maintains the same semantics as `globalThis` in JavaScript.
209
- #if _runtime(_multithreaded)
209
+ #if compiler(>=6.1) && _runtime(_multithreaded)
210
210
@LazyThreadLocal ( initialize: {
211
211
return JSObject ( id: _JS_Predef_Value_Global)
212
212
} )
0 commit comments