Class: Gitrb::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.



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

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



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

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