Hi Joel,

From: "Joel VanderWerf" <vjoel / PATH.Berkeley.EDU>
> Bill Kelly wrote:
> > 
> >   timeout(1.0) { @condition_variable.wait(@mutex) }
> > 
> Probably wrong, but... when the timeout happens, a TimeoutError is 
> raised in the thread that called #timeout. If you don't rescue this 
> error and do something with it, the thread dies (silently, unless 
> Thread.abort_on_exception is enabled). This may be why threads that have 
> called #timeout later become unresponsive. (Or maybe I'm totally wrong 
> and you are catching the TimeoutError somewhere and the problem is 
> something else.)

Right, the actual code doing the timeout looks like:

  def timed_wait(timeout_secs)
    timedout = false
    begin
      timeout(timeout_secs) { wait }
    rescue Timeout::Error
      timedout = true
    end
    !timedout
  end

And, interestingly the above is being called only on the
main thread, and the main thread keeps running.  But other
thread(s) which have their own mutexes and condition variables,
start "not being awakened" when signalled, sporradically,
depending on how often the above routine is called on the
main thread.


Regards,

Bill