Mutex is a Swift-3/4 class library for mutual exclusion locks.
If Swift Package Manager is used, add this package as a dependency in Package.swift
,
import PackageDescription
let package = Package (
name: "<your-app-name>",
dependencies: [
.Package(url: "https://github.com/itssofluffy/Mutex.git", majorVersion: 0)
]
)
Mutex
let mutex = try Mutex()
...
try mutex.lock {
result = 1
}
This project is released under the MIT license. See LICENSE for details.