userver: compiler::CoroutineSwitchBanScope Class Reference
Loading...
Searching...
No Matches
compiler::CoroutineSwitchBanScope Class Reference

#include <userver/compiler/thread_local.hpp>

Detailed Description

A scope that crashes if coroutine context switches are attempted.

This is useful to prevent accidental waiting operations in places where they would be disastrous, e.g. while holding a thread-local resource.

The check only happens in debug builds.

Definition at line 31 of file thread_local.hpp.

+ Inheritance diagram for compiler::CoroutineSwitchBanScope:

Public Member Functions

 CoroutineSwitchBanScope (CoroutineSwitchBanScope &&)=delete
 
CoroutineSwitchBanScopeoperator= (CoroutineSwitchBanScope &&)=delete
 

Constructor & Destructor Documentation

◆ CoroutineSwitchBanScope()

compiler::CoroutineSwitchBanScope::CoroutineSwitchBanScope ( )
inlinenoexcept

Definition at line 154 of file thread_local.hpp.

◆ ~CoroutineSwitchBanScope()

compiler::CoroutineSwitchBanScope::~CoroutineSwitchBanScope ( )
inline

Definition at line 160 of file thread_local.hpp.


The documentation for this class was generated from the following file: