From a7dc97c38bcd43ab8e1ed023db5a4aabcec978a0 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 30 Sep 2010 17:30:09 +0200 Subject: compat19: fix condition monitor waiting When timing out during a wait, return false instead of raising. This fixes a problem with TimeoutError being raised during restarts on ruby 1.9.x --- lib/rbot/compat19.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/rbot/compat19.rb b/lib/rbot/compat19.rb index fbb68477..c32d1ecb 100644 --- a/lib/rbot/compat19.rb +++ b/lib/rbot/compat19.rb @@ -45,6 +45,8 @@ module MonitorMixin begin @cond.wait(@monitor.instance_variable_get("@mon_mutex"), timeout) return true + rescue TimeoutError + return false ensure @monitor.__send__(:mon_enter_for_cond, count) end -- cgit v1.2.3