This is an archive of the discontinued LLVM Phabricator instance.

[Support] Use unique_function rather than std::function for ThreadPool TaskTy.
ClosedPublic

Authored by lhames on Sep 10 2020, 10:08 AM.

Details

Summary

This will allow non-copyable function objects (e.g. lambdas that capture
unique_ptrs) to be used with ThreadPool.

Diff Detail

Event Timeline

lhames created this revision.Sep 10 2020, 10:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 10 2020, 10:08 AM
Herald added a subscriber: ributzka. · View Herald Transcript
lhames requested review of this revision.Sep 10 2020, 10:08 AM
lhames updated this revision to Diff 291020.Sep 10 2020, 10:18 AM

Add a unit test.

lhames updated this revision to Diff 291021.Sep 10 2020, 10:19 AM

Fix broken diff (hopefully).

dblaikie accepted this revision.Sep 10 2020, 10:26 AM

Looks good to me - seems like a case of "if it compiles, it's good to go". I don't think I realize or otherwise I'd forgotten that we had a unique_function in LLVM - handy!

This revision is now accepted and ready to land.Sep 10 2020, 10:26 AM
This revision was landed with ongoing or failed builds.Sep 10 2020, 10:47 AM
This revision was automatically updated to reflect the committed changes.