Skip to content

Commit b53f83e

Browse files
committed
Fixed a pthread issue in debug builds for 32-bit ARM.
1 parent dacfe93 commit b53f83e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

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

4+
1. Workaround an unexpected EGAGIN error being returned by pthread in 32-bit ARM debug builds. (#508)
5+
46
1. The `SignalProducer` internals have undergone a significant refactoring, which bootstraps the effort to reduce the overhead of constant producers and producer compositions. (#487, kudos to @andersio)
57

68
# 2.0.1

Sources/Atomic.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ internal class Lock {
155155
attr.deallocate(capacity: 1)
156156
}
157157

158-
#if DEBUG
158+
// Darwin pthread for 32-bit ARM somehow returns `EAGAIN` when
159+
// using `trylock` on a `PTHREAD_MUTEX_ERRORCHECK` mutex.
160+
#if DEBUG && !arch(arm)
159161
pthread_mutexattr_settype(attr, Int32(recursive ? PTHREAD_MUTEX_RECURSIVE : PTHREAD_MUTEX_ERRORCHECK))
160162
#else
161163
pthread_mutexattr_settype(attr, Int32(recursive ? PTHREAD_MUTEX_RECURSIVE : PTHREAD_MUTEX_NORMAL))

0 commit comments

Comments
 (0)