diff options
-rw-r--r-- | lib/rainbows/fiber/base.rb | 6 | ||||
-rw-r--r-- | lib/rainbows/rev.rb | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/rainbows/fiber/base.rb b/lib/rainbows/fiber/base.rb index 090a9e4..c65b07b 100644 --- a/lib/rainbows/fiber/base.rb +++ b/lib/rainbows/fiber/base.rb @@ -5,13 +5,13 @@ module Rainbows module Fiber # blocked readers (key: Rainbows::Fiber::IO object, value is irrelevant) - RD = {} + RD = {}.compare_by_identity # blocked writers (key: Rainbows::Fiber::IO object, value is irrelevant) - WR = {} + WR = {}.compare_by_identity # sleeping fibers go here (key: Fiber object, value: wakeup time) - ZZ = {} + ZZ = {}.compare_by_identity # puts the current Fiber into uninterruptible sleep for at least # +seconds+. Unlike Kernel#sleep, this it is not possible to sleep diff --git a/lib/rainbows/rev.rb b/lib/rainbows/rev.rb index 197d138..6650c2b 100644 --- a/lib/rainbows/rev.rb +++ b/lib/rainbows/rev.rb @@ -31,6 +31,11 @@ module Rainbows # all connected clients CONN = {} + if {}.respond_to?(:compare_by_identity) + CONN.compare_by_identity + KATO.compare_by_identity + end + include Core end end |