MySQL 8.4.0
Source Code Documentation
thread_stage_guard.h File Reference

Go to the source code of this file.

Classes

class  raii::Thread_stage_guard
 RAII guard that sets a thread stage, and restores the previous stage when going out of scope. More...
 

Namespaces

namespace  raii
 

Macros

#define NAMED_THD_STAGE_GUARD(name, thd, new_stage)
 Set the thread stage for the given thread, and make it restore the previous stage at the end of the invoking scope, using the named local RAII variable. More...
 
#define THD_STAGE_GUARD(thd, new_stage)    NAMED_THD_STAGE_GUARD(_thread_stage_guard_##new_stage, (thd), (new_stage))
 Set the thread stage for the given thread, and make it restore the previous stage at the end of the invoking scope. More...
 

Macro Definition Documentation

◆ NAMED_THD_STAGE_GUARD

#define NAMED_THD_STAGE_GUARD (   name,
  thd,
  new_stage 
)
Value:
(thd), (new_stage), __func__, __FILE__, __LINE__ \
}
RAII guard that sets a thread stage, and restores the previous stage when going out of scope.
Definition: thread_stage_guard.h:34
case opt name
Definition: sslopt-case.h:29

Set the thread stage for the given thread, and make it restore the previous stage at the end of the invoking scope, using the named local RAII variable.

Parameters
nameA variable name. The macro will define a variable of type Thread_stage_guard with this name in the current scope where this macro is invoked.
thdThe thread for which the stage should be set.
new_stageThe new stage. thd will use this stage until the end of the scope where the macro is invoked. At that point, the stage is reverted to what it was before invoking this macro.

◆ THD_STAGE_GUARD

#define THD_STAGE_GUARD (   thd,
  new_stage 
)     NAMED_THD_STAGE_GUARD(_thread_stage_guard_##new_stage, (thd), (new_stage))

Set the thread stage for the given thread, and make it restore the previous stage at the end of the invoking scope.

Parameters
thdThe thread for which the stage should be set.
new_stageThe new stage. thd will use this stage until the end of the scope where the macro is invoked. At that point, the stage is reverted to what it was before invoking this macro.