Skip to content

Commit

Permalink
Be more tolerate with error code returned by pthread_mutex_trylock. (
Browse files Browse the repository at this point in the history
…#788)

* Be more tolerate with error code returned by `pthread_mutex_trylock`.

* Update changelog.
  • Loading branch information
andersio committed May 26, 2020
1 parent 4772e16 commit a3e2da9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# master
*Please add new entries at the top.*

1. Fix a debug assertion in `Lock.try()` that could be raised in earlier OS versions (< iOS 10.0, < macOS 10.12). (#747, #788)

Specifically, ReactiveSwift now recognizes `EDEADLK` as expected error code from `pthread_mutex_trylock` alongside `0`, `EBUSY` and `EAGAIN`.

# 6.3.0
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)
```swift
Expand Down
2 changes: 1 addition & 1 deletion Sources/Atomic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ internal class Lock {
switch status {
case 0:
return true
case EBUSY, EAGAIN:
case EBUSY, EAGAIN, EDEADLK:
return false
default:
assertionFailure("Unexpected pthread mutex error code: \(status)")
Expand Down

0 comments on commit a3e2da9

Please sign in to comment.