We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 03415be commit fda6d4eCopy full SHA for fda6d4e
stdlib/public/SDK/Dispatch/Queue.swift
@@ -197,10 +197,15 @@ public extension DispatchQueue {
197
flags: DispatchWorkItemFlags = [],
198
execute work: @escaping @convention(block) () -> Void)
199
{
200
- if group == nil && qos == .unspecified && flags.isEmpty {
+ if group == nil && qos == .unspecified {
201
// Fast-path route for the most common API usage
202
- __dispatch_async(self, work)
203
- return
+ if flags.isEmpty {
+ __dispatch_async(self, work)
204
+ return
205
+ } else if flags == .barrier {
206
+ __dispatch_barrier_async(self, work)
207
208
+ }
209
}
210
211
var block: @convention(block) () -> Void = work
0 commit comments