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!
alive = {}
+stop = 0
+
def f(id):
- while 1:
+ while not stop:
alive[id] = os.getpid()
try:
time.sleep(SHORTSLEEP)
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()