@@ -1328,14 +1328,12 @@ thread_sched_blocking_region_exit(struct rb_thread_sched *sched, rb_thread_t *th
13281328}
13291329
13301330void
1331- rb_thread_start_deferred_wait_thread (bool init )
1331+ rb_thread_start_deferred_wait_thread (void )
13321332{
1333- if (init ) {
1334- rb_native_mutex_initialize (& thread_deferred_wait .lock );
1335- rb_native_cond_initialize (& thread_deferred_wait .cond );
1336- ccan_list_head_init (& thread_deferred_wait .q_head );
1337- }
1338-
1333+ rb_native_mutex_initialize (& thread_deferred_wait .lock );
1334+ rb_native_cond_initialize (& thread_deferred_wait .cond );
1335+ ccan_list_head_init (& thread_deferred_wait .q_head );
1336+ thread_deferred_wait .running = true;
13391337 pthread_attr_t attr ;
13401338 int r ;
13411339 r = pthread_attr_init (& attr );
@@ -1347,23 +1345,19 @@ rb_thread_start_deferred_wait_thread(bool init)
13471345 rb_bug_errno ("start_deferred_wait_thread - pthread_create" , r );
13481346 }
13491347 pthread_attr_destroy (& attr );
1350- thread_deferred_wait .running = true;
13511348}
13521349
13531350void
1354- rb_thread_stop_deferred_wait_thread (bool destroy )
1351+ rb_thread_stop_deferred_wait_thread (void )
13551352{
13561353 rb_native_mutex_lock (& thread_deferred_wait .lock );
13571354 thread_deferred_wait .running = false;
13581355 rb_native_cond_signal (& thread_deferred_wait .cond );
13591356 rb_native_mutex_unlock (& thread_deferred_wait .lock );
13601357 pthread_join (thread_deferred_wait .thread , NULL );
1361-
1362- if (destroy ) {
1363- VM_ASSERT (ccan_list_empty (& thread_deferred_wait .q_head ));
1364- rb_native_cond_destroy (& thread_deferred_wait .cond );
1365- rb_native_mutex_destroy (& thread_deferred_wait .lock );
1366- }
1358+ VM_ASSERT (ccan_list_empty (& thread_deferred_wait .q_head ));
1359+ rb_native_cond_destroy (& thread_deferred_wait .cond );
1360+ rb_native_mutex_destroy (& thread_deferred_wait .lock );
13671361}
13681362
13691363
@@ -1795,7 +1789,7 @@ thread_sched_atfork(struct rb_thread_sched *sched)
17951789{
17961790 current_fork_gen ++ ;
17971791 rb_thread_sched_init (sched , true);
1798- rb_thread_start_deferred_wait_thread (true );
1792+ rb_thread_start_deferred_wait_thread ();
17991793 rb_thread_t * th = GET_THREAD ();
18001794 rb_vm_t * vm = GET_VM ();
18011795
0 commit comments