summaryrefslogtreecommitdiff
path: root/lib/rbot
diff options
context:
space:
mode:
authorMatthias H <apoc@sixserv.org>2013-09-04 02:28:24 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2013-11-02 11:30:39 +0100
commite9b652aa2a047557aaa1a68278d9d402f56d45b2 (patch)
tree63be90228b752e108f6f5ecd0e71e91a20b15be2 /lib/rbot
parentfbe8eeb73cf5f5d1f819ea6c0350e67014b4a26b (diff)
ruby 2.0.0: fix for changed @waiters in compat19
I don't really know what this is all about, but this fixes a bug with the compat19 monkeypatching. @waiters is now a Hash. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?revision=38109&view=revision
Diffstat (limited to 'lib/rbot')
-rw-r--r--lib/rbot/compat19.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/rbot/compat19.rb b/lib/rbot/compat19.rb
index c32d1ecb..2082ff51 100644
--- a/lib/rbot/compat19.rb
+++ b/lib/rbot/compat19.rb
@@ -12,7 +12,11 @@ class ConditionVariable
begin
# TODO: mutex should not be used
@waiters_mutex.synchronize do
- @waiters.push(Thread.current)
+ if @waiters.instance_of? Hash # ruby 2.0.0?
+ @waiters[Thread.current] = true
+ else
+ @waiters.push(Thread.current)
+ end
end
if timeout
elapsed = mutex.sleep timeout if timeout > 0.0