This is an archive of the discontinued LLVM Phabricator instance.

[bolt] Use llvm::sys::RWMutex instead of std::shared_timed_mutex
ClosedPublic

Authored by thakis on Nov 21 2022, 5:52 AM.

Details

Summary

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.

Diff Detail

Event Timeline

thakis created this revision.Nov 21 2022, 5:52 AM
Herald added a reviewer: Amir. · View Herald Transcript
Herald added a reviewer: maksfb. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
thakis requested review of this revision.Nov 21 2022, 5:52 AM
This revision is now accepted and ready to land.Nov 21 2022, 2:40 PM
This revision was landed with ongoing or failed builds.Nov 21 2022, 4:24 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptNov 21 2022, 4:25 PM