@@ -118,7 +118,6 @@ static VALUE thread_spec_rb_thread_wait_for(VALUE self, VALUE s, VALUE ms) {
118118 return Qnil ;
119119}
120120
121-
122121VALUE thread_spec_call_proc (void * arg_ptr ) {
123122 VALUE arg_array = (VALUE )arg_ptr ;
124123 VALUE arg = rb_ary_pop (arg_array );
@@ -167,6 +166,12 @@ static VALUE thread_spec_ruby_native_thread_p_new_thread(VALUE self) {
167166#endif
168167}
169168
169+ #ifdef RUBY_VERSION_IS_3_5
170+ static VALUE thread_spec_ruby_thread_has_gvl_p (VALUE self ) {
171+ return ruby_thread_has_gvl_p () ? Qtrue : Qfalse ;
172+ }
173+ #endif
174+
170175void Init_thread_spec (void ) {
171176 VALUE cls = rb_define_class ("CApiThreadSpecs" , rb_cObject );
172177 rb_define_method (cls , "rb_thread_alone" , thread_spec_rb_thread_alone , 0 );
@@ -180,6 +185,9 @@ void Init_thread_spec(void) {
180185 rb_define_method (cls , "rb_thread_create" , thread_spec_rb_thread_create , 2 );
181186 rb_define_method (cls , "ruby_native_thread_p" , thread_spec_ruby_native_thread_p , 0 );
182187 rb_define_method (cls , "ruby_native_thread_p_new_thread" , thread_spec_ruby_native_thread_p_new_thread , 0 );
188+ #ifdef RUBY_VERSION_IS_3_5
189+ rb_define_method (cls , "ruby_thread_has_gvl_p" , thread_spec_ruby_thread_has_gvl_p , 0 );
190+ #endif
183191}
184192
185193#ifdef __cplusplus
0 commit comments