Skip to content

Commit

Permalink
Fixed a pthread issue in debug builds for 32-bit ARM.
Browse files Browse the repository at this point in the history
  • Loading branch information
andersio committed Sep 4, 2017
1 parent dacfe93 commit 466869b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# master
*Please add new entries at the top.*

1. Workaround an unexpected EGAGIN error being returned by pthread in 32-bit ARM debug builds. (#508)

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)

# 2.0.1
Expand Down
4 changes: 3 additions & 1 deletion Sources/Atomic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ internal class Lock {
attr.deallocate(capacity: 1)
}

#if DEBUG
// Darwin pthread for 32-bit ARM somehow returns `EAGAIN`
// when `PTHREAD_MUTEX_ERRORCHECK` is used.
#if DEBUG && !arch(arm)
pthread_mutexattr_settype(attr, Int32(recursive ? PTHREAD_MUTEX_RECURSIVE : PTHREAD_MUTEX_ERRORCHECK))
#else
pthread_mutexattr_settype(attr, Int32(recursive ? PTHREAD_MUTEX_RECURSIVE : PTHREAD_MUTEX_NORMAL))
Expand Down

0 comments on commit 466869b

Please sign in to comment.