@@ -17,13 +17,13 @@ def initialize(name, attached_type, ancestor, statements, location)
1717
1818 def analyse_statement ( outer_scope )
1919 super ( outer_scope , attach_klass : true )
20- prepare_data_holding_struct
20+ prepare_data_holding_struct!
2121 prepare_rb_data_type_t_struct
2222 detach_and_modify_auxillary_c_functions_from_statements
2323 add_auxillary_functions_to_klass_scope
2424 prepare_auxillary_c_functions
2525 @statements [ 1 ..-1 ] . each do |stmt | # 0th stmt is the data struct
26- if ruby_method_or_c_func ?( stmt )
26+ if ruby_method_or_c_func_without_gil_lock ?( stmt )
2727 rewrite_method_with_data_fetching stmt
2828 end
2929 stmt . analyse_statement @scope
@@ -198,7 +198,7 @@ def write_data_type_t_struct(code)
198198
199199 # Prepare the data holding struct 'data' that will hold a pointer to the
200200 # struct that is attached to this class.
201- def prepare_data_holding_struct
201+ def prepare_data_holding_struct!
202202 struct_name = @name + '_data_struct'
203203 declarations = declarations_for_data_struct
204204 @data_struct = Statement ::CStructOrUnionDef . new (
@@ -230,8 +230,8 @@ def prepare_auxillary_c_functions
230230 prepare_get_struct_c_function
231231 end
232232
233- def ruby_method_or_c_func ?( stmt )
234- stmt . is_a? ( RubyMethodDef ) || stmt . is_a? ( CFunctionDef )
233+ def ruby_method_or_c_func_without_gil_lock ?( stmt )
234+ stmt . is_a? ( RubyMethodDef ) || ( stmt . is_a? ( CFunctionDef ) && ! stmt . no_gil )
235235 end
236236
237237 # Rewrite method `stmt` so that the `data` variable becomes available
0 commit comments