Kaydet (Commit) c1488413 authored tarafından Guido van Rossum's avatar Guido van Rossum

Added a provision to stop all threads before exiting from the test:

the change to regrtest.py to unload all newly imported modules did
something bad to the threads -- and I realized that they would never
stop!
üst 9d90a94f
......@@ -18,8 +18,10 @@ NUM_THREADS = 4
alive = {}
stop = 0
def f(id):
while 1:
while not stop:
alive[id] = os.getpid()
try:
time.sleep(SHORTSLEEP)
......@@ -53,5 +55,9 @@ def main():
spid, status = os.waitpid(cpid, 0)
assert spid == cpid
assert status == 0, "cause = %d, exit = %d" % (status&0xff, status>>8)
global stop
# Tell threads to die
stop = 1
time.sleep(2*SHORTSLEEP) # Wait for threads to die
main()
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