You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
408 B
24 lines
408 B
#include <stdlib.h> |
|
#include <pthread.h> |
|
#include <unistd.h> |
|
#include <stdio.h> |
|
#include <signal.h> |
|
static void* t_fn(void* v) |
|
{ |
|
sigset_t mask; |
|
|
|
sigfillset(&mask); |
|
sigsuspend(&mask); |
|
return NULL; |
|
} |
|
|
|
int main (int argc, char *argv[]) |
|
{ |
|
pthread_t t1; |
|
|
|
pthread_create(&t1, NULL, t_fn, NULL); |
|
|
|
sleep(1); // Should be enough to have the thread in sigsuspend |
|
// printf("dying\n"); |
|
exit(0); |
|
}
|
|
|