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:
parent
36bcb9a300
commit
8f4fe97286
1 changed files with 14 additions and 8 deletions
|
@ -88,12 +88,16 @@ void
|
|||
ircd::ctx::parallel<arg>::sender(const arg &a)
|
||||
noexcept
|
||||
{
|
||||
auto &p(*this->p);
|
||||
auto func
|
||||
{
|
||||
std::bind(¶llel::receiver, this)
|
||||
};
|
||||
|
||||
this->a.at(snd++) = a;
|
||||
snd %= this->a.size();
|
||||
out++;
|
||||
|
||||
auto &p(*this->p);
|
||||
auto func(std::bind(¶llel::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(¶llel::receiver, this)
|
||||
};
|
||||
|
||||
snd++;
|
||||
snd %= this->a.size();
|
||||
out++;
|
||||
|
||||
auto &p(*this->p);
|
||||
auto func(std::bind(¶llel::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
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue