Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
smart_ioc (0.5.2)
smart_ioc (0.5.3)

GEM
remote: https://rubygems.org/
Expand Down
1 change: 0 additions & 1 deletion lib/smart_ioc/bean_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ def initialize(bean_definitions_storage, extra_package_contexts)
@singleton_scope = SmartIoC::Scopes::Singleton.new
@prototype_scope = SmartIoC::Scopes::Prototype.new
@thread_scope = SmartIoC::Scopes::Request.new
@semaphore = Mutex.new
end

def clear_scopes
Expand Down
6 changes: 5 additions & 1 deletion lib/smart_ioc/bean_file_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class SmartIoC::BeanFileLoader
def initialize
@loaded_locations = {}
@load_proc = Proc.new { |location| load(location) }
@semaphore = Mutex.new
end

def set_load_proc(&block)
Expand All @@ -17,7 +18,10 @@ def require_bean(bean_name)
locations.each do |location|
next if @loaded_locations.has_key?(location)
@loaded_locations[location] = true
@load_proc.call(location)

@semaphore.synchronize do
@load_proc.call(location)
end
end

nil
Expand Down
2 changes: 1 addition & 1 deletion lib/smart_ioc/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module SmartIoC
VERSION = "0.5.2"
VERSION = "0.5.3"
end