mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd::ctx: Fix future wait condition closing.
This commit is contained in:
parent
51e3d7f081
commit
3301ed62f7
1 changed files with 3 additions and 11 deletions
|
@ -351,18 +351,10 @@ ircd::ctx::_wait_until(const future<T> &f,
|
||||||
if(unlikely(is(state, future_state::INVALID)))
|
if(unlikely(is(state, future_state::INVALID)))
|
||||||
throw no_state{};
|
throw no_state{};
|
||||||
|
|
||||||
const auto wfun
|
return state.cond.wait_until(tp, [&state]
|
||||||
{
|
{
|
||||||
[&state]
|
return !is(state, future_state::PENDING);
|
||||||
{
|
});
|
||||||
return !is(state, future_state::PENDING);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if(unlikely(!state.cond.wait_until(tp, wfun)))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return wfun();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
|
|
Loading…
Reference in a new issue