Commit 7334c5aa authored by Vincent Pelletier's avatar Vincent Pelletier

Do increment thread count even when using force.

Don't duplicate the code used to test if there are too many threads.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5669 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dba8a3b5
......@@ -473,14 +473,13 @@ class ActivityTool (Folder, UniqueObject):
# else, increase the number of active_threads and continue
tic_lock.acquire()
too_many_threads = (active_threads >= max_active_threads)
if not too_many_threads:
if not too_many_threads or force:
active_threads += 1
else:
tic_lock.release()
raise RuntimeError, 'Too many threads'
tic_lock.release()
if too_many_threads :
if not force:
raise RuntimeError, 'Too many threads'
# Initialize if needed
if not is_initialized: self.initialize()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment