         }
     }
 
-    private func _cancel() -> ContiguousArray<() -> Void>? {
-        _lock.lock(); defer { _lock.unlock() }
-        let observers = _observers
-        _observers = nil // transition to `isCancelling` state
+    private func _cancel() -> [() -> Void]? {
+        lock.lock()
+        defer { lock.unlock() }
+
+        let observers = self.observers
+        self.observers = nil // transition to `isCancelling` state
         return observers
     }
 }
-
-// We use the same lock across different tokens because the design of CTS
-// prevents potential issues. For example, closures registered with a token
-// are never executed inside a lock.
-private let _lock = NSLock()
 
 /// Enables cooperative cancellation of operations.
 ///

        return CancellationToken(source: self)
    }

    private var _observers: ContiguousArray<() -> Void>? = []

    /// Initializes the `CancellationTokenSource` instance.
    init() {}

internal final class CancellationTokenSource {
    /// Returns `true` if cancellation has been requested.
    var isCancelling: Bool {
        return lock.sync { observers == nil }
    }

    /// Creates a new token associated with the source.
