From: Philip Mak Date: 2003-09-21T03:21:25+09:00 Subject: Re: Deadlock? Nobu Nokada wrote: > Mutex uses Thread#stop to wait to be unlocked. I don't think I'm doing very much with Mutex, though. I only have these two things: @@mutex.synchronize do @@num_sending += 1 end @@mutex.synchronize do @@num_sending -= 1 end Those should be executed fairly quickly, shouldn't they? Since I'm just incrementing and decrementing a number. >> Anyone know what to make of this 62.65% time consumption by >> Thread#stop? Could it be that somehow my threads are deadlocking >> each other? > > Do you define the signal handler? The only signal handling code in my program is this, which happens in the main thread: ["SIGTERM", "SIGINT"].each do |sig| trap(sig) { shutdown } end Is that what you're referring to when you say "signal handler"?