class ThreadSafeArray
Public Class Methods
new()
click to toggle source
# File lib/adhearsion/foundation/thread_safety.rb, line 13 def initialize @mutex = ::Mutex.new @array = [] end
Public Instance Methods
method_missing(method, *args, &block)
click to toggle source
# File lib/adhearsion/foundation/thread_safety.rb, line 18 def method_missing(method, *args, &block) @mutex.synchronize do @array.send method, *args, &block end end