Skip to content

Commit 4f1282e

Browse files
committed
FIx WASI build issue
1 parent 39941be commit 4f1282e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/OpenSwiftUI/Core/Util/ThreadUtils.swift

+4
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ import Foundation
99

1010
@inline(__always)
1111
func performOnMainThread(_ block: @escaping () -> Void) {
12+
#if os(WASI) // Thread and RunLoopMode.common is not avaiable on WASI currently
13+
block()
14+
#else
1215
if Thread.isMainThread {
1316
block()
1417
} else {
1518
RunLoop.main.perform(inModes: [.common], block: block)
1619
}
20+
#endif
1721
}

0 commit comments

Comments
 (0)