From: Aliaksey Kandratsenka Date: 2010-01-28T18:51:42+09:00 Subject: [ruby-core:27925] [Bug #2564] [patch] re-initialize timer_thread_{lock,cond} after fork Issue #2564 has been updated by Aliaksey Kandratsenka. Indeed. I was wrong. But there's still bug in 1.9.1. native_stop_timer_thread() doesn't wait till timer thread is dead. trunk does pthread_join (which implies that lock is free), and 1.9.1-243 does not. See http://redmine.ruby-lang.org/repositories/entry/ruby-191/thread_pthread.c line 813. You should merge r25629 to 1.9.1. My patch is not necessary. And it doesn't solve issue completely as I see now. 'cause child can see some bad state left by running timer_thread_function. BTW, you can simplify rb_thread_create_timer_thread. There's no need to hold lock around pthread_create and there's no need to signal timer thread condition there. timer thread observes system_working in a reliable way, so there's no race with immediate native_stop_timer_thread and there's no gain in that for rb_thread_create_timer_thread. ---------------------------------------- http://redmine.ruby-lang.org/issues/show/2564 ---------------------------------------- http://redmine.ruby-lang.org