@@ -877,7 +877,9 @@ thread_sched_wait_running_turn(struct rb_thread_sched *sched, rb_thread_t *th, b
877877 thread_sched_set_unlocked (sched , th );
878878 {
879879 RUBY_DEBUG_LOG ("nt:%d cond:%p" , th -> nt -> serial , & th -> nt -> cond .readyq );
880+ fprintf (stderr , "thread cond_wait start. th->nt: %lx sched: %lx\n" , (int ) th -> nt , (int ) sched );
880881 rb_native_cond_wait (& th -> nt -> cond .readyq , & sched -> lock_ );
882+ fprintf (stderr , "thread cond_wait complete. th->nt: %lx sched: %lx\n" , (int ) th -> nt , (int ) sched );
881883 }
882884 thread_sched_set_locked (sched , th );
883885
@@ -1756,6 +1758,7 @@ static void clear_thread_cache_altstack(void);
17561758void
17571759rb_thread_sched_destroy (struct rb_thread_sched * sched )
17581760{
1761+ fprintf (stderr , "sched_destroy: %lx" , (int ) sched );
17591762 deferred_wait_thread_detach_sched (sched );
17601763
17611764 /*
@@ -2048,6 +2051,7 @@ native_thread_destroy_atfork(struct rb_native_thread *nt)
20482051
20492052 RB_ALTSTACK_FREE (nt -> altstack );
20502053 ruby_xfree (nt -> nt_context );
2054+ fprintf (stderr , "thread destroy 2. nt: %lx \n" , (int ) nt );
20512055 ruby_xfree (nt );
20522056 }
20532057}
@@ -2056,6 +2060,8 @@ static void
20562060native_thread_destroy (struct rb_native_thread * nt )
20572061{
20582062 if (nt ) {
2063+ fprintf (stderr , "thread destroy 1. nt: %lx \n" , (int ) nt );
2064+
20592065 rb_native_cond_destroy (& nt -> cond .readyq );
20602066
20612067 if (& nt -> cond .readyq != & nt -> cond .intr ) {
0 commit comments