mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd::ctx: Allow this_ctx::interruption toggle to no-op if no ctx.
This commit is contained in:
parent
b796668a77
commit
ccf5b79e6a
1 changed files with 13 additions and 3 deletions
16
ircd/ctx.cc
16
ircd/ctx.cc
|
@ -565,21 +565,31 @@ ircd::ctx::this_ctx::stack_at_here()
|
|||
|
||||
/// Throws interrupted if the currently running context was interrupted
|
||||
/// and clears the interrupt flag.
|
||||
///
|
||||
/// Unlike most of this_ctx::, this function is a no-op if not currently
|
||||
/// on a context.
|
||||
void
|
||||
ircd::ctx::this_ctx::interruptible(const bool &b)
|
||||
{
|
||||
interruptible(b, std::nothrow);
|
||||
interruption_point();
|
||||
if(likely(current))
|
||||
{
|
||||
interruptible(cur(), b);
|
||||
interruption_point();
|
||||
}
|
||||
}
|
||||
|
||||
/// Throws interrupted if the currently running context was interrupted
|
||||
/// and clears the interrupt flag.
|
||||
///
|
||||
/// Unlike most of this_ctx::, this function is a no-op if not currently
|
||||
/// on a context.
|
||||
void
|
||||
ircd::ctx::this_ctx::interruptible(const bool &b,
|
||||
std::nothrow_t)
|
||||
noexcept
|
||||
{
|
||||
interruptible(cur(), b);
|
||||
if(likely(current))
|
||||
interruptible(cur(), b);
|
||||
}
|
||||
|
||||
/// Throws interrupted if the currently running context was interrupted
|
||||
|
|
Loading…
Reference in a new issue