0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-02-20 02:30:07 +01:00

ircd::ctx: Add notify() to dock to rotate the waiters in contrast to notify_one().

This commit is contained in:
Jason Volk 2016-11-01 03:54:52 -07:00
parent 6f7dde8fdf
commit b0bc025ced

View file

@ -50,6 +50,7 @@ class dock
void notify_all() noexcept;
void notify_one() noexcept;
void notify() noexcept;
dock() = default;
~dock() noexcept;
@ -62,6 +63,19 @@ noexcept
assert(q.empty());
}
inline void
dock::notify()
noexcept
{
if(q.empty())
return;
auto c(q.front());
q.pop_front();
q.emplace_back(c);
ircd::ctx::notify(*c);
}
inline void
dock::notify_one()
noexcept
@ -69,7 +83,7 @@ noexcept
if(q.empty())
return;
notify(*q.front());
ircd::ctx::notify(*q.front());
}
inline void
@ -78,7 +92,7 @@ noexcept
{
const auto copy(q);
for(const auto &c : copy)
notify(*c);
ircd::ctx::notify(*c);
}
inline void