0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-02-18 09:40:12 +01:00

ircd::ctx::parallel: Various cleanup; clarify counting mechanisms.

This commit is contained in:
Jason Volk 2019-01-17 15:51:41 -08:00
parent 36bcb9a300
commit 8f4fe97286

View file

@ -88,12 +88,16 @@ void
ircd::ctx::parallel<arg>::sender(const arg &a)
noexcept
{
auto &p(*this->p);
auto func
{
std::bind(&parallel::receiver, this)
};
this->a.at(snd++) = a;
snd %= this->a.size();
out++;
auto &p(*this->p);
auto func(std::bind(&parallel::receiver, this));
if(likely(p.size()))
p(std::move(func));
else
@ -105,12 +109,16 @@ void
ircd::ctx::parallel<arg>::sender()
noexcept
{
auto &p(*this->p);
auto func
{
std::bind(&parallel::receiver, this)
};
snd++;
snd %= this->a.size();
out++;
auto &p(*this->p);
auto func(std::bind(&parallel::receiver, this));
if(likely(p.size()))
p(std::move(func));
else
@ -122,10 +130,8 @@ void
ircd::ctx::parallel<arg>::receiver()
noexcept
{
auto &a
{
this->a.at(rcv++ % this->a.size())
};
auto &a(this->a.at(rcv % this->a.size()));
rcv++;
if(!this->eptr) try
{