We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 20792fe + add063e commit 3639fbeCopy full SHA for 3639fbe
src/swift/Queue.swift
@@ -181,10 +181,15 @@ public extension DispatchQueue {
181
flags: DispatchWorkItemFlags = [],
182
execute work: @escaping @convention(block) () -> Void)
183
{
184
- if group == nil && qos == .unspecified && flags.isEmpty {
+ if group == nil && qos == .unspecified {
185
// Fast-path route for the most common API usage
186
- CDispatch.dispatch_async(self.__wrapped, work)
187
- return
+ if flags.isEmpty {
+ CDispatch.dispatch_async(self.__wrapped, work)
188
+ return
189
+ } else if flags == .barrier {
190
+ CDispatch.dispatch_barrier_async(self.__wrapped, work)
191
192
+ }
193
}
194
195
var block: @convention(block) () -> Void = work
0 commit comments