mirror of
https://github.com/matrix-construct/construct
synced 2024-05-29 00:03:45 +02:00
ircd::ctx::pool: Simplify notify on work completion.
This commit is contained in:
parent
5534672a07
commit
d4e41218b0
|
@ -35,6 +35,7 @@ struct ircd::ctx::pool
|
|||
queue<closure> q;
|
||||
std::vector<context> ctxs;
|
||||
|
||||
private:
|
||||
void work();
|
||||
void main() noexcept;
|
||||
|
||||
|
|
11
ircd/ctx.cc
11
ircd/ctx.cc
|
@ -1565,17 +1565,16 @@ try
|
|||
q.pop()
|
||||
};
|
||||
|
||||
const scope_notify notify
|
||||
{
|
||||
q_max
|
||||
};
|
||||
|
||||
const scope_count working
|
||||
{
|
||||
this->working
|
||||
};
|
||||
|
||||
const unwind avail{[this]()
|
||||
noexcept
|
||||
{
|
||||
q_max.notify();
|
||||
}};
|
||||
|
||||
// Execute the user's function
|
||||
func();
|
||||
|
||||
|
|
Loading…
Reference in a new issue