Skip to content

Commit a3e2da9

Browse files
authored
Be more tolerate with error code returned by pthread_mutex_trylock. (#788)
* Be more tolerate with error code returned by `pthread_mutex_trylock`. * Update changelog.
1 parent 4772e16 commit a3e2da9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# master
22
*Please add new entries at the top.*
33

4+
1. Fix a debug assertion in `Lock.try()` that could be raised in earlier OS versions (< iOS 10.0, < macOS 10.12). (#747, #788)
5+
6+
Specifically, ReactiveSwift now recognizes `EDEADLK` as expected error code from `pthread_mutex_trylock` alongside `0`, `EBUSY` and `EAGAIN`.
7+
48
# 6.3.0
59
1. `Property` and `MutableProperty` can now be used as property wrapper. Note that they remain a reference type container, so it may not be appropriate to use them in types requiring value semantics. (#781)
610
```swift

Sources/Atomic.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ internal class Lock {
178178
switch status {
179179
case 0:
180180
return true
181-
case EBUSY, EAGAIN:
181+
case EBUSY, EAGAIN, EDEADLK:
182182
return false
183183
default:
184184
assertionFailure("Unexpected pthread mutex error code: \(status)")

0 commit comments

Comments
 (0)