This is an archive of the discontinued LLVM Phabricator instance.

Simplify GetGlobalProperties functions of Thread/Process/Target
ClosedPublic

Authored by labath on Feb 29 2016, 3:38 AM.

Details

Summary

"Initialization of function-local statics is guaranteed to occur only once even when called from
multiple threads, and may be more efficient than the equivalent code using std::call_once."
http://en.cppreference.com/w/cpp/thread/call_once

I'd add that it's also more readable.

Diff Detail

Repository
rL LLVM

Event Timeline

labath updated this revision to Diff 49356.Feb 29 2016, 3:38 AM
labath retitled this revision from to Simplify GetGlobalProperties functions of Thread/Process/Target.
labath updated this object.
labath added reviewers: clayborg, zturner.
labath added a subscriber: lldb-commits.
zturner edited edge metadata.Feb 29 2016, 7:39 AM
zturner added a subscriber: zturner.

The reason for this is that msvc didn't support this until 2015. I'm fine
with these changes but i think you guys still need 2013 for a while longer,
right?

I suspected something like that might be up. Thanks.

The VS2015 migration for us is taking longer than expected, but we are now nearing the end, hopefully. If there are no objections, I'll land this after we are done.

clayborg accepted this revision.Feb 29 2016, 10:37 AM
clayborg edited edge metadata.

Looks good to me, commit when you know this will work with MSVC versions you need. All other platforms will be good to go.

This revision is now accepted and ready to land.Feb 29 2016, 10:37 AM
This revision was automatically updated to reflect the committed changes.