diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2010-09-30 17:30:09 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2010-09-30 17:30:09 +0200 |
commit | a7dc97c38bcd43ab8e1ed023db5a4aabcec978a0 (patch) | |
tree | b0260a1f11e6ff8ebec582346c90372b4d90163c /lib/rbot/compat19.rb | |
parent | a8b718b824a443dbe4a9e4cadc11561473de8e17 (diff) |
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
Diffstat (limited to 'lib/rbot/compat19.rb')
-rw-r--r-- | lib/rbot/compat19.rb | 2 |
1 files changed, 2 insertions, 0 deletions
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 |