lib/adhearsion/foundation/thread_safety.rb in adhearsion-2.0.0.alpha3 vs lib/adhearsion/foundation/thread_safety.rb in adhearsion-2.0.0.beta1

- old
+ new

@@ -6,18 +6,24 @@ @mutex.synchronize &block end end class ThreadSafeArray - include Enumerable - def initialize @mutex = Mutex.new @array = [] end def method_missing(method, *args, &block) @mutex.synchronize do @array.send method, *args, &block end + end + + def inspect + @mutex.synchronize { @array.inspect } + end + + def to_s + @mutex.synchronize { @array.to_s } end end