Skip to content

Commit 48515be

Browse files
authored
Update README.md
1 parent 894c3b6 commit 48515be

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

README.md

+11-9
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,28 @@
77

88
# Introduction
99

10-
**AllocatedLock** is a lightweight cross platform lock with an API compatible with [`OSAllocatedUnfairLock`](https://developer.apple.com/documentation/os/osallocatedunfairlock). The lock wraps [`os_unfair_lock_t`](https://developer.apple.com/documentation/os/os_unfair_lock_t) on Darwin platforms, [`pthread_mutex_t`](https://man.freebsd.org/cgi/man.cgi?pthread_mutex_lock(3)) on Linux and [`SRWLOCK`](https://learn.microsoft.com/en-us/windows/win32/sync/slim-reader-writer--srw--locks) on Windows.
10+
**swift-mutex** is a cross platform lock backporting the Swift 6 [`Mutex`](https://developer.apple.com/documentation/synchronization/mutex) API to Swift 5.9 and all Darwin platforms.
11+
12+
Mutex is built upon AllocatedLock which is cross platform lock with an API compatible with [`OSAllocatedUnfairLock`](https://developer.apple.com/documentation/os/osallocatedunfairlock). The lock wraps [`os_unfair_lock_t`](https://developer.apple.com/documentation/os/os_unfair_lock_t) on Darwin platforms, [`pthread_mutex_t`](https://man.freebsd.org/cgi/man.cgi?pthread_mutex_lock(3)) on Linux and [`SRWLOCK`](https://learn.microsoft.com/en-us/windows/win32/sync/slim-reader-writer--srw--locks) on Windows.
1113

1214
# Installation
1315

14-
AllocatedLock can be installed by using Swift Package Manager.
16+
The package can be installed by using Swift Package Manager.
1517

16-
**Note:** AllocatedLock requires Swift 5.7 on Xcode 14+. It runs on iOS 13+, tvOS 13+, macOS 10.15+, Linux and Windows.
18+
**Note:** Mutex requires Swift 5.9 on Xcode 15+. It runs on iOS 13+, tvOS 13+, macOS 10.15+, Linux and Windows.
1719
To install using Swift Package Manager, add this to the `dependencies:` section in your Package.swift file:
1820

1921
```swift
20-
.package(url: "https://github.com/swhitty/AllocatedLock.git", .upToNextMajor(from: "0.0.3"))
22+
.package(url: "https://github.com/swhitty/swift-mutex.git", .upToNextMajor(from: "0.0.4"))
2123
```
2224

2325
# Usage
2426

25-
Usage is similar with [`OSAllocatedUnfairLock`](https://developer.apple.com/documentation/os/osallocatedunfairlock).
27+
Usage is similar to [`Mutex`](https://developer.apple.com/documentation/synchronization/mutex)
2628

27-
The recommended usage to create a lock that protects some state:
29+
The recommended usage to create a mutex that protects some state:
2830
```swift
29-
let state = AllocatedLock<Int>(initialState: 0)
31+
let state = Mutex<Int>(0)
3032
```
3133

3234
Use `.withLock` to acquire the lock to read the state:
@@ -41,6 +43,6 @@ let val = state.withLock { $0 += 1 }
4143

4244
# Credits
4345

44-
AllocatedLock is primarily the work of [Simon Whitty](https://github.com/swhitty).
46+
swift-mutex is primarily the work of [Simon Whitty](https://github.com/swhitty).
4547

46-
([Full list of contributors](https://github.com/swhitty/AllocatedLock/graphs/contributors))
48+
([Full list of contributors](https://github.com/swhitty/swift-mutex/graphs/contributors))

0 commit comments

Comments
 (0)