mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd::ctx: Consistent use of interruption.
This commit is contained in:
parent
38c5679b5a
commit
10434c96c5
1 changed files with 3 additions and 9 deletions
12
ircd/ctx.cc
12
ircd/ctx.cc
|
@ -925,7 +925,7 @@ noexcept
|
|||
// Can't join to bare metal, only from within another context.
|
||||
if(current)
|
||||
{
|
||||
terminate();
|
||||
interrupt();
|
||||
join();
|
||||
return;
|
||||
}
|
||||
|
@ -993,7 +993,7 @@ ircd::ctx::pool::pool(const char *const &name,
|
|||
ircd::ctx::pool::~pool()
|
||||
noexcept
|
||||
{
|
||||
terminate();
|
||||
interrupt();
|
||||
join();
|
||||
assert(ctxs.empty());
|
||||
assert(queue.empty());
|
||||
|
@ -1021,10 +1021,7 @@ ircd::ctx::pool::del(const size_t &num)
|
|||
|
||||
const uninterruptible ui;
|
||||
while(ctxs.size() > target)
|
||||
{
|
||||
ctxs.back().terminate();
|
||||
ctxs.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1037,10 +1034,7 @@ ircd::ctx::pool::add(const size_t &num)
|
|||
void
|
||||
ircd::ctx::pool::join()
|
||||
{
|
||||
for(auto &context : ctxs)
|
||||
context.join();
|
||||
|
||||
ctxs.clear();
|
||||
del(size());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue