@@ -59,8 +59,6 @@ def getExtendedAttribute(self, _name):
5959parser = argparse .ArgumentParser ()
6060parser .add_argument ('--wasm64' , action = 'store_true' , default = False ,
6161 help = 'Build for wasm64' )
62- parser .add_argument ('--thread_safe' , action = 'store_true' , default = False ,
63- help = 'Emit temporaries as "static thread_local" to avoid race conditions' )
6462parser .add_argument ('infile' )
6563parser .add_argument ('outfile' )
6664options = parser .parse_args ()
@@ -390,7 +388,7 @@ def type_to_cdec(raw):
390388
391389def render_function (class_name , func_name , sigs , return_type , non_pointer ,
392390 copy , operator , constructor , is_static , func_scope ,
393- call_content = None , const = False , array_attribute = False , thread_safe = False ):
391+ call_content = None , const = False , array_attribute = False ):
394392 legacy_mode = CHECKS not in ['ALL' , 'FAST' ]
395393 all_checks = CHECKS == 'ALL'
396394
@@ -626,13 +624,10 @@ def make_call_args(i):
626624 basic_return = 'return ' if constructor or return_type != 'Void' else ''
627625 return_prefix = basic_return
628626 return_postfix = ''
629- storage_attribute = ''
630627 if non_pointer :
631628 return_prefix += '&'
632- if thread_safe :
633- storage_attribute = 'thread_local '
634629 if copy :
635- pre += ' static %s%s temp;\n ' % ( storage_attribute , type_to_c (return_type , non_pointing = True ) )
630+ pre += ' static thread_local %s temp;\n ' % type_to_c (return_type , non_pointing = True )
636631 return_prefix += '(temp = '
637632 return_postfix += ', &temp)'
638633
@@ -770,8 +765,7 @@ def add_bounds_check_impl():
770765 constructor ,
771766 is_static = m .isStatic (),
772767 func_scope = m .parentScope .identifier .name ,
773- const = m .getExtendedAttribute ('Const' ),
774- thread_safe = options .thread_safe )
768+ const = m .getExtendedAttribute ('Const' ))
775769 mid_js += ['\n ' ]
776770 if constructor :
777771 mid_js += build_constructor (name )
@@ -813,8 +807,7 @@ def add_bounds_check_impl():
813807 func_scope = interface ,
814808 call_content = get_call_content ,
815809 const = m .getExtendedAttribute ('Const' ),
816- array_attribute = m .type .isArray (),
817- thread_safe = options .thread_safe )
810+ array_attribute = m .type .isArray ())
818811
819812 if m .readonly :
820813 mid_js += [r'''
@@ -836,8 +829,7 @@ def add_bounds_check_impl():
836829 func_scope = interface ,
837830 call_content = set_call_content ,
838831 const = m .getExtendedAttribute ('Const' ),
839- array_attribute = m .type .isArray (),
840- thread_safe = options .thread_safe )
832+ array_attribute = m .type .isArray ())
841833 mid_js += [r'''
842834/** @suppress {checkTypes} */
843835Object.defineProperty(%s.prototype, '%s', { get: %s.prototype.%s, set: %s.prototype.%s });
@@ -855,8 +847,7 @@ def add_bounds_check_impl():
855847 False ,
856848 False ,
857849 func_scope = interface ,
858- call_content = 'delete self' ,
859- thread_safe = options .thread_safe )
850+ call_content = 'delete self' )
860851
861852 # Emit C++ class implementation that calls into JS implementation
862853
0 commit comments