mirror of
https://github.com/matrix-construct/construct
synced 2024-11-17 15:30:52 +01:00
ircd::ctx: Add context::WAIT_JOIN feature flag.
This commit is contained in:
parent
08479976ad
commit
6fbd29b1ed
2 changed files with 7 additions and 1 deletions
|
@ -104,6 +104,7 @@ enum ircd::ctx::context::flags
|
|||
NOINTERRUPT = 0x0008, ///< Interruption points won't throw while lit.
|
||||
SLICE_EXEMPT = 0x0010, ///< The watchdog will ignore excessive cpu usage.
|
||||
STACK_EXEMPT = 0x0020, ///< The watchdog will ignore excessive stack usage.
|
||||
WAIT_JOIN = 0x0040, ///< Destruction of instance won't terminate ctx.
|
||||
|
||||
INTERRUPTED = 0x4000, ///< (INDICATOR) Marked
|
||||
TERMINATED = 0x8000, ///< (INDICATOR)
|
||||
|
|
|
@ -1221,7 +1221,12 @@ noexcept
|
|||
if(current)
|
||||
{
|
||||
const uninterruptible::nothrow ui;
|
||||
terminate();
|
||||
|
||||
// When the WAIT_JOIN flag is given we wait for the context to
|
||||
// complete cooperatively before this destructs.
|
||||
if(~c->flags & context::WAIT_JOIN)
|
||||
terminate();
|
||||
|
||||
join();
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue