9 void *slavethread(void *arg
)
15 int main(int argc
, char **argv
)
17 const struct timespec alittle
= { 0, 1000000000 / 100 }; // 0.01 seconds.
19 for (i
= 0; i
< 10; i
++) {
21 if (pthread_create(&slave
, 0, slavethread
, 0)) {
22 perror("pthread_create");
30 sleep(2); // Should be enough to ensure (some) threads are created
31 for (i
= 0; i
< 20 && kill(pid
, SIGTERM
) == 0; i
++)
32 nanosleep(&alittle
, NULL
);
41 fprintf(stderr
, "strange, this program is supposed to be killed!\n");