Commit Graph

4 Commits

Author SHA1 Message Date
John McCall
3343331ded Remove the ConditionVariable abstraction. 2021-12-20 18:04:19 -05: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
Kuba (Brecka) Mracek
ea6cae658e Make waiting on condition variables error out on SWIFT_STDLIB_SINGLE_THREADED_RUNTIME (#33788) 2020-09-03 18:44:47 -07:00
Kuba (Brecka) Mracek
9ead8d57fa Add a single-threaded stdlib mode, use it for the 'minimal' stdlib (#33437) 2020-08-25 06:03:14 -07:00