mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 00:32:35 +01:00
ircd::ctx: Atomize the dock notification and the then callback during promise notify().
This commit is contained in:
parent
fbb9cf0196
commit
fbcc64fbbd
1 changed files with 9 additions and 3 deletions
|
@ -90,16 +90,22 @@ template<class T>
|
|||
void
|
||||
ircd::ctx::notify(shared_state<T> &st)
|
||||
{
|
||||
st.cond.notify_all();
|
||||
|
||||
if(!st.then)
|
||||
{
|
||||
st.cond.notify_all();
|
||||
return;
|
||||
}
|
||||
|
||||
if(!current)
|
||||
return st.then(st);
|
||||
{
|
||||
st.cond.notify_all();
|
||||
st.then(st);
|
||||
return;
|
||||
}
|
||||
|
||||
ircd::post([&st]
|
||||
{
|
||||
st.cond.notify_all();
|
||||
st.then(st);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue