Locks and Atomic
Provides locks and Atomic<T>
import Atomic
platforms: [
.macOS(.v10_12)
],
dependencies: [
.package(url: "https://github.com/std-swift/Atomic.git",
from: "1.0.0")
],
targets: [
.target(
name: "",
dependencies: [
"Atomic"
]),
]
Lockable
Provides functions to perform on locks (lock
, unlock
, with
)
Semaphore
and RwLock
implement Lockable
Atomic<T>
Controlls access to a value using a lock. &=
can be used as shorthand for get
and set
.
Atomic<Bool>
has .toggle()
Atomic<T: SignedInteger>
has .negate()