This is an archive of the discontinued LLVM Phabricator instance.

Replace all standard mutexes with equivalent stl mutexes.
AbandonedPublic

Authored by zturner on Jun 19 2014, 2:17 PM.

Details

Reviewers
None
Summary

No functionality change, but I'm posting this for wider review before submitting.

This is a re-attempt at getting D4033 in. The suggestions from that thread have been taken into consideration, and all pre-requisite tasks have been implemented as separate changelists.

This patch should be fairly uncontroversial, as there are no semantic changes involved. The only replacements here are replacing always-acquired mutexes with different always-acquired mutexes. Still, since it's kind of a sweeping change, I'll leave it up for a day or two to give people a chance to comment.

Diff Detail

Event Timeline

zturner updated this revision to Diff 10660.Jun 19 2014, 2:17 PM
zturner retitled this revision from to Replace all standard mutexes with equivalent stl mutexes..
zturner updated this object.
zturner edited the test plan for this revision. (Show Details)
zturner added a reviewer: chandlerc.
zturner set the repository for this revision to rL LLVM.
zturner added a subscriber: Unknown Object (MLST).
chandlerc edited edge metadata.Jun 19 2014, 3:02 PM

Any particular reason for universally using recursive_mutex? I feel like a lot of these would be pretty easily switched to mutex.

lib/ExecutionEngine/OProfileJIT/OProfileWrapper.cpp
34–35

This is entertainingly unlikely to be correct (both before and after your change)

lib/Support/ErrorHandling.cpp
43

And another likely place we need a managed static.

lib/Support/Unix/Process.inc
268

This looks like a bug on Windows, might be worth moving to a managed static.

lib/Target/NVPTX/NVPTXUtilities.cpp
37

And here.

In D4223#6, @chandlerc wrote:

Any particular reason for universally using recursive_mutex? I feel like a lot of these would be pretty easily switched to mutex.

I actually had the same thought, but I felt that a secondary pass in a separate patch would be better for dealing with this. The idea with this patch is to not change any behavior anywhere, only the mutex implementation. So recursive mutexes are replaced with recursive mutexes, and non-recursive mutexes (which ironically there's only 1 of, and in a unittest no less) are replaced with non-recursive mutexes.

zturner added inline comments.Jun 19 2014, 3:55 PM
lib/Support/Unix/Process.inc
268

If you mean because of MSVC's lack of thread-safe function local statics, this is a unix-specific file.

zturner abandoned this revision.Oct 15 2015, 1:55 PM