mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Make some tests more frienly to MemoryError.
Free memory, unlock hanging threads.
This commit is contained in:
parent
d7aa5248fb
commit
9db55004a1
6 changed files with 43 additions and 16 deletions
|
@ -39,8 +39,12 @@ class Bunch(object):
|
|||
self.finished.append(tid)
|
||||
while not self._can_exit:
|
||||
_wait()
|
||||
for i in range(n):
|
||||
start_new_thread(task, ())
|
||||
try:
|
||||
for i in range(n):
|
||||
start_new_thread(task, ())
|
||||
except:
|
||||
self._can_exit = True
|
||||
raise
|
||||
|
||||
def wait_for_started(self):
|
||||
while len(self.started) < self.n:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue