@@ -29,7 +29,7 @@ public class JSObject: Equatable {
2929 @_spi ( JSObject_id)
3030 public var id : JavaScriptObjectRef
3131
32- #if _runtime(_multithreaded)
32+ #if compiler(>=6.1) && _runtime(_multithreaded)
3333 private let ownerThread : pthread_t
3434#endif
3535
@@ -47,14 +47,14 @@ public class JSObject: Equatable {
4747 /// is a programmer error and will result in a runtime assertion failure because JavaScript
4848 /// object spaces are not shared across threads backed by Web Workers.
4949 private func assertOnOwnerThread( hint: @autoclosure ( ) -> String ) {
50- #if _runtime(_multithreaded)
50+ #if compiler(>=6.1) && _runtime(_multithreaded)
5151 precondition ( pthread_equal ( ownerThread, pthread_self ( ) ) != 0 , " JSObject is being accessed from a thread other than the owner thread: \( hint ( ) ) " )
5252 #endif
5353 }
5454
5555 /// Asserts that the two objects being compared are owned by the same thread.
5656 private static func assertSameOwnerThread( lhs: JSObject , rhs: JSObject , hint: @autoclosure ( ) -> String ) {
57- #if _runtime(_multithreaded)
57+ #if compiler(>=6.1) && _runtime(_multithreaded)
5858 precondition ( pthread_equal ( lhs. ownerThread, rhs. ownerThread) != 0 , " JSObject is being accessed from a thread other than the owner thread: \( hint ( ) ) " )
5959 #endif
6060 }
@@ -206,7 +206,7 @@ public class JSObject: Equatable {
206206
207207 // `JSObject` storage itself is immutable, and use of `JSObject.global` from other
208208 // threads maintains the same semantics as `globalThis` in JavaScript.
209- #if _runtime(_multithreaded)
209+ #if compiler(>=6.1) && _runtime(_multithreaded)
210210 @LazyThreadLocal ( initialize: {
211211 return JSObject ( id: _JS_Predef_Value_Global)
212212 } )
0 commit comments