lib/bunny/channel_id_allocator.rb in bunny-1.0.0.pre1 vs lib/bunny/channel_id_allocator.rb in bunny-1.0.0.pre2
- old
+ new
@@ -1,6 +1,7 @@
require "thread"
+require "monitor"
require "amq/int_allocator"
module Bunny
# Bitset-based channel id allocator. When channels are closed,
# ids are released back to the pool.
@@ -16,10 +17,10 @@
#
# @param [Integer] max_channel Max allowed channel id
def initialize(max_channel = ((1 << 16) - 1))
@allocator = AMQ::IntAllocator.new(1, max_channel)
- @mutex = Mutex.new
+ @mutex = Monitor.new
end
# Returns next available channel id. This method is thread safe.
#