diff options
-rw-r--r-- | lib/rbot/compat19.rb | 6 |
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 |