Skip to content

Commit

Permalink
action/network: Fixed lock - use class-based mutex instead of instanc…
Browse files Browse the repository at this point in the history
…e-based

Related to [GH-148]
  • Loading branch information
legal90 committed Oct 16, 2014
1 parent ada86e1 commit ee04620
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/vagrant-parallels/action/network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module Action
class Network
include Vagrant::Util::NetworkIP
include Vagrant::Util::ScopedHashOverride
@@lock = Mutex.new

def initialize(app, env)
@app = app
Expand All @@ -24,7 +25,6 @@ def initialize(app, env)

def call(env)
@env = env
@lock = Mutex.new

# Get the list of network adapters from the configuration
network_adapters_config = env[:machine].provider_config.network_adapters.dup
Expand Down Expand Up @@ -89,7 +89,7 @@ def call(env)
# Get the virtual network adapter configuration
# We wrap this in locks to avoid race conditions between multiple
# Vagrant threads and/or processes.
@lock.synchronize do
@@lock.synchronize do
begin
env[:machine].env.lock('parallels-network-adapters') do
adapter = send("#{type}_adapter", config)
Expand Down

0 comments on commit ee04620

Please # to comment.