0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd::ctx: Block the caller after submit when parallel saturated.

This commit is contained in:
Jason Volk 2018-12-26 17:35:49 -08:00
parent d80a39097c
commit 4c5891e354

View file

@ -66,32 +66,34 @@ template<class arg>
void
ircd::ctx::parallel<arg>::operator()(const arg &a)
{
wait_avail();
if(this->eptr)
std::rethrow_exception(this->eptr);
this->a.at(snd++) = a;
snd %= this->a.size();
out++;
auto &p(*this->p);
p(std::bind(&parallel::receiver, this));
out++;
wait_avail();
}
template<class arg>
void
ircd::ctx::parallel<arg>::operator()()
{
wait_avail();
if(this->eptr)
std::rethrow_exception(this->eptr);
snd++;
snd %= this->a.size();
out++;
auto &p(*this->p);
p(std::bind(&parallel::receiver, this));
out++;
wait_avail();
}
template<class arg>