             }
         }
     }
+    
+    func addOpToSet(op: NSOperation) {
+        dispatch_async(opsQueue) {
+            self.ops.insert(op)
+        }
+    }
+    
+    func removeOpFromSet(op: NSOperation) {
+        dispatch_async(opsQueue) {
+            self.ops.remove(op)
+        }
+    }
 }

                finishHandler: { [weak self] in
                    if let q = self {
                        q.delegate?.operationQueue?(q, operationDidFinish: $0, withErrors: $1)
                        q.ops.remove($0)
                    }
                }
            )

            operation.addCompletionBlock { [weak self, weak operation] in
                guard let queue = self, let operation = operation else { return }
                queue.delegate?.operationQueue?(queue, operationDidFinish: operation, withErrors: [])
                queue.removeOpFromSet(operation)
            }
        }
        
