This is an archive of the discontinued LLVM Phabricator instance.

Replace the Execution Engine's mutex with std::recursive_mutex
ClosedPublic

Authored by zturner on Jun 18 2014, 10:19 AM.

Details

Summary

This replaces the EE's mutex with std::recursive_mutex.

This change has a bit of a trickle-down effect, due to the fact that the EE's mutex is not self-contained, and is used by a number of derived implementations, as well as exposed and used directly by the ValueMap class. So all of these must be changed at once in the same CL, and there's no good way to break it up.

Diff Detail

Repository
rL LLVM

Event Timeline

zturner updated this revision to Diff 10575.Jun 18 2014, 10:19 AM
zturner retitled this revision from to Replace the Execution Engine's mutex with std::recursive_mutex.
zturner updated this object.
zturner edited the test plan for this revision. (Show Details)
zturner added reviewers: dblaikie, rnk.
zturner set the repository for this revision to rL LLVM.
zturner added a subscriber: Unknown Object (MLST).
rnk accepted this revision.Jun 18 2014, 1:12 PM
rnk edited edge metadata.

lgtm

This revision is now accepted and ready to land.Jun 18 2014, 1:12 PM
zturner closed this revision.Jun 18 2014, 1:25 PM
zturner updated this revision to Diff 10586.

Closed by commit rL211214 (authored by @zturner).

FYI - this commit broke LLVM build using win32 threads flavor of the mingw toolchain. I am getting error: 'recursive_mutex' in namespace 'std' does not name a type.
Not sure if this would be considered a problem for LLVM...

+llvmdev.

I find this pretty surprising. Actually, we already use std::mutex and
std::recursive_mutex in clang, lld, and other llvm projects, it's just a
coincidence that it hadn't been introduced into LLVM until my commits.

I'm not sure what the right thing to do here is. If I understand
correctly, it seems like in order to encounter this, a) you must be using
GCC, b) you must be using the MinGW flavor of GCC, and c) you must be using
the threads-win32 flavor of this toolchain. Only if all 3 of those are
true, then std::mutex and std::recursive_mutex don't exist.

Anybody else have thoughts on whether this necessitates reverting the mutex
changes, or whether this toolchain configuration should be supported?