swift6.SynchronizedDictionary.mustache Maven / Gradle / Ivy
The newest version!
// SynchronizedDictionary.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
internal struct SynchronizedDictionary : @unchecked Sendable {
private var dictionary = [K: V]()
private let lock = NSRecursiveLock()
internal subscript(key: K) -> V? {
get {
lock.withLock {
self.dictionary[key]
}
}
set {
lock.withLock {
self.dictionary[key] = newValue
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy