0
0
Fork 0
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:
Jason Volk 2018-03-15 11:59:54 -07:00
parent fbb9cf0196
commit fbcc64fbbd

View file

@ -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);
});
}