From: ts Date: 2002-05-15T22:22:57+09:00 Subject: Re: [BUG] thread failure after trap >>>>> "J" == Jakub Travnik writes: J> If rb_trap_exec is executed, errno is no longer valid No, not really J> However this does not solve problem in the script above. J> Problem is probably in thread switching somewhere. The problem, I think, is that when rb_thread_trap_eval() is executed the main_thread lost its status and wait_for (call to rb_thread_ready(main_thread)). At the end of the code executed by #trap, the main_thread has the status THREAD_RUNNABLE and wait_for = 0, this is why ruby enter in the accept(2) Perhaps a solution is to save these values (in th_status and th_wait_for before the call to rb_thread_ready(main_thread)) and restore it when ruby execute thread_switch(RESTORE_TRAP) Guy Decoux