From: Gennady Bystritsky Date: 2004-06-10T16:37:02+09:00 Subject: Re: Signals and threads On Jun 9, 2004, at 6:52 PM, nobu.nokada@softhome.net wrote: > Hi, > > At Thu, 10 Jun 2004 04:22:41 +0900, > Gennady wrote in [ruby-talk:102985]: >> If I have several threads and set a signal handler proc with >> Kernel::trap, what thread will actually execute the handler? Is it >> always guaranteed to be the main thread as I see it now? > > Yes, it's a feature. Thank you very much, Nobu. By the way, I was trying to temporarily set a signal handler with trap: sigquit_handler = trap "SIGQUIT", "IGNORE" ... trap "SIGQUIT", sigquit_handler I noticed that when the first trap returns nil, the second one does not restore a signal handler to "DEFAULT", as I would expect. I have to do something like that: trap "SIGQUIT", (sigquit_handler or "DEFAULT") Thanks again, Gennady. > > -- > Nobu Nakada > > Sincerely, Gennady Bystritsky