mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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
2.6 KiB
2.6 KiB