10 /* wait a second, so as to guarantee that the parent access
11 the malloc'd area, then free it. */
12 static void* thread_func(void* arg
)
19 int main(int argc
, char** argv
)
24 fprintf(stderr
, "Start.\n");
30 fprintf(stderr
, "Pointer to allocated memory: %p\n", s_mem
);
32 pthread_create(&tid
, NULL
, thread_func
, NULL
);
34 /* Write, which isn't coordinated with the free ==> a race
35 should be reported. */
37 __asm__
__volatile__("" : : "r"((long)c
) );
39 pthread_join(tid
, NULL
);
40 fprintf(stderr
, "Done.\n");