From a3395c1a96a3f116254e026acd1ccd066b6e9e09 Mon Sep 17 00:00:00 2001 From: Everett Maus Date: Fri, 4 Dec 2020 17:09:54 -0800 Subject: [PATCH] Change generated options to be thread_local. (#5583) Signed-off-by: Everett Maus --- src/options/mkoptions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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() -- 2.30.2