mirror of
https://github.com/matrix-construct/construct
synced 2025-01-14 00:34:18 +01:00
ircd::ctx: Expose critical_assertion related details.
This commit is contained in:
parent
4a51b3382c
commit
2f88540f3c
2 changed files with 13 additions and 7 deletions
|
@ -11,11 +11,15 @@
|
|||
#pragma once
|
||||
#define HAVE_IRCD_CTX_CRITICAL_ASSERTION_H
|
||||
|
||||
namespace ircd::ctx {
|
||||
inline namespace this_ctx
|
||||
namespace ircd::ctx
|
||||
{
|
||||
struct critical_assertion; // Assert no yielding for a section
|
||||
}}
|
||||
inline namespace this_ctx
|
||||
{
|
||||
struct critical_assertion; // Assert no yielding for a section
|
||||
}
|
||||
|
||||
void assert_critical();
|
||||
}
|
||||
|
||||
/// An instance of critical_assertion detects an attempt to context switch.
|
||||
///
|
||||
|
|
|
@ -853,11 +853,13 @@ noexcept
|
|||
|
||||
namespace ircd::ctx
|
||||
{
|
||||
thread_local bool critical_asserted;
|
||||
|
||||
static void assert_critical();
|
||||
extern thread_local bool critical_asserted;
|
||||
}
|
||||
|
||||
decltype(ircd::ctx::critical_asserted)
|
||||
thread_local
|
||||
ircd::ctx::critical_asserted;
|
||||
|
||||
#ifndef NDEBUG
|
||||
ircd::ctx::this_ctx::critical_assertion::critical_assertion()
|
||||
:theirs{critical_asserted}
|
||||
|
|
Loading…
Reference in a new issue