83 void (*do_func)(
void *),
void *do_func_arg) {
90 if (state->compare_exchange_strong(never_done,
IN_PROGRESS)) {
118#ifndef UNIV_HOTBACKUP
Execute a given function exactly once in a multi-threaded environment or wait for the function to be ...
Definition: os0once.h:63
static void do_or_wait_for_done(std::atomic< state_t > *state, void(*do_func)(void *), void *do_func_arg)
Call a given function or wait its execution to complete if it is already called by another thread.
Definition: os0once.h:82
static const state_t NEVER_DONE
Not yet executed.
Definition: os0once.h:69
static const state_t DONE
Finished execution.
Definition: os0once.h:75
static const state_t IN_PROGRESS
Currently being executed by this or another thread.
Definition: os0once.h:72
uint32_t state_t
Control variables' state type.
Definition: os0once.h:66
bool in_progress()
Check if upgrade is in progress.
Definition: upgrade.cc:113
Macros for using atomics.
Version control for database, common definitions, and include files.
#define ut_error
Abort execution.
Definition: ut0dbg.h:64
#define ut_a(EXPR)
Abort execution if EXPR does not evaluate to nonzero.
Definition: ut0dbg.h:56
#define UT_RELAX_CPU()
Definition: ut0ut.h:86