This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Modernize ThreadLauncher
ClosedPublic

Authored by labath on Feb 22 2022, 6:16 AM.

Details

Summary

Accept a function object instead of a raw pointer. This avoids a bunch
of boilerplate typically needed to pass arguments to the thread
functions.

Diff Detail

Event Timeline

labath created this revision.Feb 22 2022, 6:16 AM
labath requested review of this revision.Feb 22 2022, 6:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 22 2022, 6:16 AM
JDevlieghere accepted this revision.Feb 22 2022, 1:30 PM

Nice cleanup

lldb/source/Host/common/HostNativeThreadBase.cpp
55–58

make_unique maybe?

This revision is now accepted and ready to land.Feb 22 2022, 1:30 PM
labath added inline comments.Feb 23 2022, 5:23 AM
lldb/source/Host/common/HostNativeThreadBase.cpp
55–58

This isn't creating a new object. It's taking ownership of an object that was created in the caller (and passed disguised as a void*).

This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Feb 23 2022, 5:37 AM

Looks like this breaks building on Windows: http://45.33.8.238/win/53761/step_4.txt

Please take a look.