6 /* Simple test program, no race: parent only modified x after child
7 has modified it and then joined with the parent. Tests simple
8 thread lifetime segment handling. */
12 void* child_fn ( void* arg
)
14 /* Unprotected relative to parent, but in child's segment only */
23 x
++; /* happens in parent's segment */
25 if (pthread_create(&child
, NULL
, child_fn
, NULL
)) {
26 perror("pthread_create");
30 if (pthread_join(child
, NULL
)) {
31 perror("pthread join");
35 /* Now back in parent's segment */