0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-28 08:24:08 +01:00

ircd::ctx: Fix bitrot in when_all() template.

This commit is contained in:
Jason Volk 2018-04-10 20:05:30 -07:00
parent fff36e0d42
commit c3062e80f1

View file

@ -42,9 +42,9 @@ ircd::ctx::when_all(it first,
promise<void> p; promise<void> p;
const auto set_then const auto set_then
{ {
[&p](auto &f) [&p](it &f)
{ {
f.st.then = [p] f->state().then = [p]
(shared_state_base &) mutable (shared_state_base &) mutable
{ {
then(p); then(p);
@ -55,7 +55,7 @@ ircd::ctx::when_all(it first,
future<void> ret(p); future<void> ret(p);
for(; first != last; ++first) for(; first != last; ++first)
if(is(first->state(), future_state::PENDING)) if(is(first->state(), future_state::PENDING))
set_then(*first); set_then(first);
if(refcount(p.state()) <= 1) if(refcount(p.state()) <= 1)
p.set_value(); p.set_value();