[PATCH] D114363: [ThreadPool] Do not return shared futures.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 25 09:37:13 PST 2021


fhahn added a comment.

In D114363#3154232 <https://reviews.llvm.org/D114363#3154232>, @DanielMcIntosh-IBM wrote:

> In D114363#3152433 <https://reviews.llvm.org/D114363#3152433>, @dblaikie wrote:
>
>> In D114363#3152052 <https://reviews.llvm.org/D114363#3152052>, @fhahn wrote:
>>
>>> Funnily enough this is causing a build failure when threads are disabled, because `Tasks.push([Future]() { Future.get(); }); ` won't work. I reverted the patch for now.
>>>
>>> Any ideas on how to best deal with that? :)
>>
>> Sounds like it might be due to lambda capture by value/copy (but if you could copy/paste the error it might help diagnose) - maybe capturing by move is all that's required?
>>
>>   [Future = std::move(Future)]() { Future.get(); }
>
> I put the error message in a comment on this review: D114183 <https://reviews.llvm.org/D114183>, since that is the one that introduced the failure.

Are you sure? IIUC the problem was the change to not using shared_future. It built fine with `LLVM_ENABLE_THREADS=Off` with *this* patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114363/new/

https://reviews.llvm.org/D114363



More information about the llvm-commits mailing list