File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,8 @@ void rb_thread_io_close_wait(struct rb_io *);
6464
6565void rb_ec_check_ints (struct rb_execution_context_struct * ec );
6666
67+ void rb_thread_free_native_thread (void * th_ptr );
68+
6769RUBY_SYMBOL_EXPORT_BEGIN
6870
6971void * rb_thread_prevent_fork (void * (* func )(void * ), void * data ); /* for ext/socket/raddrinfo.c */
Original file line number Diff line number Diff line change @@ -529,6 +529,15 @@ thread_cleanup_func(void *th_ptr, int atfork)
529529 rb_native_mutex_destroy (& th -> interrupt_lock );
530530}
531531
532+ void
533+ rb_thread_free_native_thread (void * th_ptr )
534+ {
535+ rb_thread_t * th = th_ptr ;
536+
537+ native_thread_destroy_atfork (th -> nt );
538+ th -> nt = NULL ;
539+ }
540+
532541static VALUE rb_threadptr_raise (rb_thread_t * , int , VALUE * );
533542static VALUE rb_thread_to_s (VALUE thread );
534543
Original file line number Diff line number Diff line change @@ -3306,8 +3306,7 @@ ruby_vm_destruct(rb_vm_t *vm)
33063306 rb_id_table_free (vm -> constant_cache );
33073307 set_free_table (vm -> unused_block_warning_table );
33083308
3309- xfree (th -> nt );
3310- th -> nt = NULL ;
3309+ rb_thread_free_native_thread (th );
33113310
33123311#ifndef HAVE_SETPROCTITLE
33133312 ruby_free_proctitle ();
You can’t perform that action at this time.
0 commit comments