Skip to content

Commit

Permalink
remove unnecessary lock
Browse files Browse the repository at this point in the history
  • Loading branch information
Bengt committed Apr 23, 2014
1 parent e7d2d5c commit 25e336a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions metaopt/invoker/multiprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,16 +215,16 @@ def stop_call(self, call_id):
Gets called by a timer in an individual thread.
"""
with self._lock:
assert call_id is not None
self._worker_provider.release(call_id=call_id)
try:
self._worker_provider.provision(number_of_workers=1)
except IndexError:
# An invoke call provisioned another worker, already.
# Therefore another worker took the place of the one we killed.
# That is OK, moving on.
pass

assert call_id is not None
self._worker_provider.release(call_id=call_id)
try:
self._worker_provider.provision(number_of_workers=1)
except IndexError:
# An invoke call provisioned another worker, already.
# Therefore another worker took the place of the one we killed.
# That is OK, moving on.
pass

@stoppable_method
@stopping_method
Expand Down

0 comments on commit 25e336a

Please sign in to comment.