(2011/09/20 2:22), Tomoyuki Chikanaga wrote:
> 
> Issue #5343 has been updated by Tomoyuki Chikanaga.
> 
> 
> Hi,
> 
> I've found that this issue is not specific problem of TCPServer#accept.
> 
> The following script also rarely blocks forever.
> 
> require "thread"
> 
> queue = Queue.new
> r, w = IO.pipe
> th = Thread.start {
>   queue.push(nil)
>   r.read 1
> }
> queue.pop
> th.kill.join
> 
> I guess this is because SIGVTALRM from send from ubf_select() is received by blocking thread after GVL release but before enter poll(2)/ppoll(2).

Thanks.  I understand.  How about it?

Index: thread_pthread.c
===================================================================
--- thread_pthread.c	(revision 33272)
+++ thread_pthread.c	(working copy)
@@ -1013,6 +1013,7 @@
 {
     rb_thread_t *th = (rb_thread_t *)ptr;
     add_signal_thread_list(th);
+    rb_thread_wakeup_timer_thread(); /* activate timer thread */
     ubf_select_each(th);
 }



-- 
// SASADA Koichi at atdot dot net