24#ifndef MY_RCU_LOCK_INCLUDED
25#define MY_RCU_LOCK_INCLUDED
137 return rcu_global_.load(std::memory_order_relaxed);
173 return rcu_global_.exchange(newT, std::memory_order_release);
188 bool stopped =
false;
207 if (!oldT)
return false;
static mysql_service_status_t init()
Component initialization.
Definition: audit_api_message_emit.cc:571
High level read API for readers.
Definition: my_rcu_lock.h:113
ReadLock(MyRcuLock *l)
construct a new read lock scope guard
Definition: my_rcu_lock.h:118
~ReadLock()
Definition: my_rcu_lock.h:120
MyRcuLock operator=(const ReadLock)=delete
MyRcuLock * _lock
Definition: my_rcu_lock.h:124
ReadLock(const ReadLock &)=delete
A class that implements a limited version of the Read-Copy-Update lock pattern.
Definition: my_rcu_lock.h:80
bool wait_for_no_readers()
Low level API: wait for no active readers.
Definition: my_rcu_lock.h:187
MyRcuLock(const T *init)
Set up the RCU lock and the global.
Definition: my_rcu_lock.h:90
char rcu_padding_[128]
padding to break the CPU cache lines
Definition: my_rcu_lock.h:220
void operator=(const MyRcuLock &)=delete
disabled
bool write_wait_and_delete(const T *newT)
A RCU writer API.
Definition: my_rcu_lock.h:205
const T * rcu_write(const T *newT)
Low level API: write a new global and return the old one.
Definition: my_rcu_lock.h:172
MyRcuLock(const MyRcuLock &)=delete
disabled
void rcu_end_read()
Low level API: end reading.
Definition: my_rcu_lock.h:153
std::atomic< const T * > rcu_global_
the global pointer to protect
Definition: my_rcu_lock.h:218
std::atomic< long > rcu_readers_
the readers counter
Definition: my_rcu_lock.h:222
~MyRcuLock()
Destructor.
Definition: my_rcu_lock.h:105
const T * rcu_read()
Low level API: start reading.
Definition: my_rcu_lock.h:135
Header for compiler-dependent features.
#define MY_COMPILER_DIAGNOSTIC_PUSH()
save the compiler's diagnostic (enabled warnings, errors, ...) state
Definition: my_compiler.h:285
#define MY_COMPILER_DIAGNOSTIC_POP()
restore the compiler's diagnostic (enabled warnings, errors, ...) state
Definition: my_compiler.h:286
#define MY_COMPILER_CLANG_WORKAROUND_REF_DOCBUG()
ignore -Wdocumentation compiler warnings for @see @ref
Definition: my_compiler.h:332
Defines for getting and processing the current system type programmatically.
void my_sleep(time_t m_seconds)
Wait a given number of microseconds.
Definition: my_systime.h:64