1 """This test checks for correct fork() behavior.
3 We want fork1() semantics -- only the forking thread survives in the
6 On some systems (e.g. Solaris without posix threads) we find that all
7 active threads survive in the child after a fork(); this is an error.
11 import os
, sys
, time
, thread
21 alive
[id] = os
.getpid()
23 time
.sleep(SHORTSLEEP
)
29 thread
.start_new(f
, (i
,))
44 for key
in alive
.keys():
50 spid
, status
= os
.waitpid(cpid
, 0)
52 assert status
== 0, "cause = %d, exit = %d" % (status
&0xff, status
>>8)