9 void *slavethread(void *arg
)
15 int main(int argc
, char **argv
)
18 for (i
= 0; i
< 10; i
++) {
20 if (pthread_create(&slave
, 0, slavethread
, 0)) {
21 perror("pthread_create");
29 sleep(2); // Should be enough to ensure (some) threads are created
30 for (i
= 0; i
< 20 && kill(pid
, SIGTERM
) == 0; i
++)
40 fprintf(stderr
, "strange, this program is supposed to be killed!\n");