Skip to content

Commit 5871161

Browse files
Pushkar N Kulkarniphausler
authored andcommitted
Fix warnings in NSOperation (#551)
1 parent 7fa60fa commit 5871161

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Foundation/NSOperation.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ open class Operation: NSObject {
6565
// The completion block property is a bit cagey and can not be executed locally on the queue due to thread exhaust potentials.
6666
// This sets up for some strange behavior of finishing operations since the handler will be executed on a different queue
6767
if let completion = completionBlock {
68-
DispatchQueue.global(attributes: .qosBackground).async { () -> Void in
68+
DispatchQueue.global(qos: .background).async { () -> Void in
6969
completion()
7070
}
7171
}
@@ -326,9 +326,9 @@ open class OperationQueue: NSObject {
326326
} else {
327327
effectiveName = "NSOperationQueue::\(Unmanaged.passUnretained(self).toOpaque())"
328328
}
329-
let attr: DispatchQueueAttributes
329+
let attr: DispatchQueue.Attributes
330330
if maxConcurrentOperationCount == 1 {
331-
attr = .serial
331+
attr = []
332332
} else {
333333
attr = .concurrent
334334
if maxConcurrentOperationCount != NSOperationQueueDefaultMaxConcurrentOperationCount {
@@ -408,7 +408,7 @@ open class OperationQueue: NSObject {
408408
group.enter()
409409
}
410410

411-
let block = DispatchWorkItem(group: queueGroup, flags: .enforceQoS) { () -> Void in
411+
let block = DispatchWorkItem(flags: .enforceQoS) { () -> Void in
412412
if let sema = self._concurrencyGate {
413413
sema.wait()
414414
self._runOperation()
@@ -420,7 +420,7 @@ open class OperationQueue: NSObject {
420420
group.leave()
421421
}
422422
}
423-
_underlyingQueue.async(execute: block)
423+
_underlyingQueue.async(group: queueGroup, execute: block)
424424
#endif
425425
}
426426
#if DEPLOYMENT_ENABLE_LIBDISPATCH

0 commit comments

Comments
 (0)