From: Everett Maus Date: Sat, 5 Dec 2020 01:09:54 +0000 (-0800) Subject: Change generated options to be thread_local. (#5583) X-Git-Tag: cvc5-1.0.0~2496 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a3395c1a96a3f116254e026acd1ccd066b6e9e09;p=cvc5.git Change generated options to be thread_local. (#5583) Signed-off-by: Everett Maus --- diff --git a/src/options/mkoptions.py b/src/options/mkoptions.py index 08f54f608..a12a0070b 100644 --- a/src/options/mkoptions.py +++ b/src/options/mkoptions.py @@ -175,7 +175,7 @@ TPL_OPTION_STRUCT_RW = \ bool wasSetByUser() const; void set(const type& v); const char* getName() const; -}} {name} CVC4_PUBLIC;""" +}} thread_local {name} CVC4_PUBLIC;""" TPL_OPTION_STRUCT_RO = \ """extern struct CVC4_PUBLIC {name}__option_t @@ -184,7 +184,7 @@ TPL_OPTION_STRUCT_RO = \ type operator()() const; bool wasSetByUser() const; const char* getName() const; -}} {name} CVC4_PUBLIC;""" +}} thread_local {name} CVC4_PUBLIC;""" TPL_DECL_SET = \ @@ -629,7 +629,7 @@ def codegen_module(module, dst_dir, tpl_module_h, tpl_module_cpp): accs.append(TPL_IMPL_WAS_SET_BY_USER.format(name=option.name)) # Global definitions - defs.append('struct {name}__option_t {name};'.format(name=option.name)) + defs.append('thread_local struct {name}__option_t {name};'.format(name=option.name)) if option.mode: values = option.mode.keys()