28 #ifndef _REG_EXP_DEFINER_H_ 29 #define _REG_EXP_DEFINER_H_ 32 #include <boost/regex.hpp> 48 #define STATIC_REGEXP_EXPR_1(var_name, xpr_text, reg_exp_flags) \ 49 static std::atomic<bool> regexp_initialized_1(false);\ 50 volatile uint32_t local_is_initialized_1 = regexp_initialized_1;\ 51 if(!local_is_initialized_1)\ 52 gregexplock.get_lock().lock();\ 53 static const boost::regex var_name(xpr_text , reg_exp_flags);\ 54 if(!local_is_initialized_1)\ 56 regexp_initialized_1 = true;\ 57 gregexplock.get_lock().unlock();\ 60 #define STATIC_REGEXP_EXPR_2(var_name, xpr_text, reg_exp_flags) \ 61 static std::atomic<bool> regexp_initialized_2(false);\ 62 volatile uint32_t local_is_initialized_2 = regexp_initialized_2;\ 63 if(!local_is_initialized_2)\ 64 gregexplock.get_lock().lock().lock();\ 65 static const boost::regex var_name(xpr_text , reg_exp_flags);\ 66 if(!local_is_initialized_2)\ 68 regexp_initialized_2 = true;\ 69 gregexplock.get_lock().lock().unlock();\ 72 #define STATIC_REGEXP_EXPR_3(var_name, xpr_text, reg_exp_flags) \ 73 static std::atomic<bool> regexp_initialized_3(false);\ 74 volatile uint32_t local_is_initialized_3 = regexp_initialized_3;\ 75 if(!local_is_initialized_3)\ 76 gregexplock.get_lock().lock().lock();\ 77 static const boost::regex var_name(xpr_text , reg_exp_flags);\ 78 if(!local_is_initialized_3)\ 80 regexp_initialized_3 = true;\ 81 gregexplock.get_lock().lock().unlock();\ 85 #endif //_REG_EXP_DEFINER_H_ static const global_regexp_critical_section gregexplock
Definition: reg_exp_definer.h:46
Definition: reg_exp_definer.h:37
critical_section & get_lock() const
Definition: reg_exp_definer.h:43
global_regexp_critical_section()
Definition: reg_exp_definer.h:42
critical_section regexp_lock
Definition: reg_exp_definer.h:40
TODO: (mj-xmr) This will be reduced in an another PR.
Definition: byte_slice.h:39