lib/konstructor/main.rb in konstructor-1.0.1 vs lib/konstructor/main.rb in konstructor-1.0.2
- old
+ new
@@ -65,10 +65,12 @@
end
DEFAULT_NAMES = [:initialize]
RESERVED_NAMES = [:new, :initialize]
+ extend MonitorMixin
+
class << self
def reserved?(name)
RESERVED_NAMES.include?(name.to_sym)
end
@@ -88,14 +90,18 @@
end
end
def declare(klass, new_method_names)
setup_method_added_hook(klass)
- get_or_init_factory(klass).declare(new_method_names)
+ synchronize do
+ get_or_init_factory(klass).declare(new_method_names)
+ end
end
def method_added_to_klass(klass, method_name)
- get_or_init_factory(klass).method_added_to_klass(method_name)
+ synchronize do
+ get_or_init_factory(klass).method_added_to_klass(method_name)
+ end
end
def is?(klass, method_name)
default?(method_name) || declared?(klass, method_name)
end
\ No newline at end of file