Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 7aa6841

Browse files
johnno1962Anton Pogonets
authored and
Anton Pogonets
committed
Separate main queue for Android.
1 parent 6c16484 commit 7aa6841

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/swift/Queue.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,17 @@ extension DispatchQueue {
116116
_swift_dispatch_apply_current(iterations, work)
117117
}
118118

119+
#if os(Android)
120+
private static let androidSwiftMain = DispatchQueue(label: "AndroidSwiftMain")
121+
122+
public class var main: DispatchQueue {
123+
return androidSwiftMain
124+
}
125+
#else
119126
public class var main: DispatchQueue {
120-
return DispatchQueue(queue: _swift_dispatch_get_main_queue())
127+
return DispatchQueue(queue: _swift_dispatch_get_main_queue())
121128
}
129+
#endif
122130

123131
@available(macOS, deprecated: 10.10, message: "")
124132
@available(iOS, deprecated: 8.0, message: "")

0 commit comments

Comments
 (0)