Class: Gitrb::Util::Synchronized

Inherits:
Object
  • Object
show all
Defined in:
lib/gitrb/util.rb

Instance Method Summary collapse

Constructor Details

#initialize(obj) ⇒ Synchronized

Returns a new instance of Synchronized.



22
23
24
25
# File 'lib/gitrb/util.rb', line 22

def initialize(obj)
  @obj = obj
  @mutex = Mutex.new
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object



27
28
29
# File 'lib/gitrb/util.rb', line 27

def method_missing(*args)
  @mutex.synchronize { @obj.send(*args) }
end