Commit Graph

11 Commits

Author SHA1 Message Date
John McCall
3343331ded Remove the ConditionVariable abstraction. 2021-12-20 18:04:19 -05:00
Daniel Rodríguez Troitiño
a8bb9ffcec [android] Android seems to support constexpr mutex with NDK 19c (at least) (#38686)
The usage of constexpr was disabled in 2016 in #2345, but using NDK 19c,
it seems that the usage doesn't fail compiling at the moment.
2021-08-02 08:48:34 -07:00
Mike Ash
dd6c235a2d [Runtime] Use os_unfair_lock for Mutex and StaticMutex on Darwin.
os_unfair_lock is much smaller than pthread_mutex_t (4 bytes versus 64) and a bit faster.

However, it doesn't support condition variables. Most of our uses of Mutex don't use condition variables, but a few do. Introduce ConditionMutex and StaticConditionMutex, which allow condition variables and continue to use pthread_mutex_t.

On all other platforms, we continue to use the same backing mutex type for both Mutex and ConditionMutex.

rdar://problem/45412121
2020-11-06 13:05:37 -05:00
Max Desiatov
74158e8b6d [Runtime] Define WebAssembly/WASI MutexPThread macros as 0 2020-05-09 17:57:51 +01:00
Calvin Hill
aee81d272f Add Initial platform support for Haiku. (#11583) 2017-09-22 21:06:56 -04:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Joe Groff
3081a1e9bc Namespace #defines that weren't SWIFT_-prefixed.
NFC
2016-06-17 11:02:47 -07:00
Brian Gesiak
66c4c87aae [Runtime] Android does not support constexpr
As with Cygwin, Android must not use `constexpr` for pthread
initializers.
2016-04-29 14:51:41 -04:00
Shawn Erickson
16c39d92f1 [runtime] predicate the use of constexpr on what the platform can support
At the moment CYGWIN pthreads implementation doesn't support the use of constexpr for static allocation versions. The way they define things results in a reinterpret_cast which violates constexpr.
2016-04-22 11:45:03 -07:00
Shawn Erickson
a0452be947 [runtime] enhanced and refactored recently added Mutex abstraction
- added read / write lock support
- added non-fatal error support to allow use of mutex in fatal error reporting pathway
- isolated pthread implementation to it own header/cpp file pair
- expanded unit tests to cover new code as well as better test existing mutex
- removed a layer of complexity that added no real value
2016-04-06 13:02:37 -07:00