Skip to content

Commit 0b87e45

Browse files
bubskikevints
authored andcommitted
OperationQueue.current implemented
1 parent 1fa2cfd commit 0b87e45

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Foundation/Operation.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,13 @@ open class OperationQueue: NSObject {
317317
let lock = NSLock()
318318
#if DEPLOYMENT_ENABLE_LIBDISPATCH
319319
var __concurrencyGate: DispatchSemaphore?
320-
var __underlyingQueue: DispatchQueue?
320+
var __underlyingQueue: DispatchQueue? {
321+
didSet {
322+
let key = OperationQueue.OperationQueueKey
323+
oldValue?.setSpecific(key: key, value: nil)
324+
__underlyingQueue?.setSpecific(key: key, value: Unmanaged.passUnretained(self))
325+
}
326+
}
321327
let queueGroup = DispatchGroup()
322328
#endif
323329

0 commit comments

Comments
 (0)