mirror of
https://github.com/matrix-construct/construct
synced 2025-01-13 16:33:53 +01:00
ircd::ctx: Fix future_state test grate.
This commit is contained in:
parent
712b343017
commit
668d12bf72
1 changed files with 19 additions and 1 deletions
|
@ -163,7 +163,25 @@ bool
|
|||
ircd::ctx::is(const shared_state<T> &st,
|
||||
const future_state &state_)
|
||||
{
|
||||
return state(st) == state_;
|
||||
switch(st.st)
|
||||
{
|
||||
case future_state::READY:
|
||||
case future_state::OBSERVED:
|
||||
case future_state::RETRIEVED:
|
||||
return state_ == st.st;
|
||||
|
||||
default: switch(state_)
|
||||
{
|
||||
case future_state::INVALID:
|
||||
return st.p == nullptr;
|
||||
|
||||
case future_state::PENDING:
|
||||
return uintptr_t(st.p) >= 0x1000;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Internal; get the current state of the shared_state; safe but unnecessary
|
||||
|
|
Loading…
Reference in a new issue