Swiftpack.co - Package - std-swift/Atomic

Atomic

Provides locks and Atomic<T>

Importing

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"
		]),
]

Using

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()

Github

link
Stars: 0
Help us keep the lights on

Dependencies

Used By

Total: 1