Skip to content

Commit f74f213

Browse files
authored
Always use pthread_rwlock on Apple platforms (#70151)
pthread_rwlock is faster than std::shared_mutex, especially in heavily threaded code such as the Swift compiler. rdar://117445844
1 parent 5e51363 commit f74f213

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

llvm/include/llvm/Support/RWMutex.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@
1919
#include <mutex>
2020
#include <shared_mutex>
2121

22-
// std::shared_timed_mutex is only available on macOS 10.12 and later.
23-
#if defined(__APPLE__) && defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
24-
#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200
22+
#if defined(__APPLE__)
2523
#define LLVM_USE_RW_MUTEX_IMPL
2624
#endif
27-
#endif
2825

2926
namespace llvm {
3027
namespace sys {

0 commit comments

Comments
 (0)