[bolt] Use llvm::sys::RWMutex instead of std::shared_timed_mutex
authorNico Weber <thakis@chromium.org>
Mon, 21 Nov 2022 13:45:45 +0000 (08:45 -0500)
committerNico Weber <thakis@chromium.org>
Tue, 22 Nov 2022 00:24:32 +0000 (19:24 -0500)
commite8ce5f1ec9f399669274000cb90d3a8214285194
treedb25808c41f7c5a38e6cfaa089403380e9c69875
parent99b3849d89cfdbc60ce4e18fc9c70dfd377bd93b
[bolt] Use llvm::sys::RWMutex instead of std::shared_timed_mutex

This has the following advantages:
- std::shared_timed_mutex is macOS 10.12+ only. llvm::sys::RWMutex
  automatically switches to a different implementation internally
  when targeting older macOS versions.
- bolt only needs std::shared_mutex, not std::shared_timed_mutex.
  llvm::sys::RWMutex automatically uses std::shared_mutex internally
  where available.

std::shared_mutex and RWMutex have the same API, so no code changes
other than types and includes are needed.

Differential Revision: https://reviews.llvm.org/D138423
bolt/include/bolt/Core/BinaryContext.h
bolt/include/bolt/Core/BinaryFunction.h
bolt/include/bolt/Passes/Aligner.h
bolt/include/bolt/Passes/Instrumentation.h
bolt/lib/Core/BinaryBasicBlock.cpp
bolt/lib/Core/BinaryContext.cpp
bolt/lib/Core/Exceptions.cpp
bolt/lib/Core/ParallelUtilities.cpp
bolt/lib/Passes/Aligner.cpp
bolt/lib/Passes/Instrumentation.cpp