int s, sig;
sigset_t set;
pthread_t thread_ceva,thread_sync;
sigemptyset(&set);
sigaddset(&set, SIGCHLD);
s = pthread_sigmask(SIG_SETMASK, &set, NULL);
if (s != 0)
//handle_error_en(s, "pthread_sigmask");
//s = pthread_create(&thread_sync, NULL, &sync_thread, (void *)&set);
//if (s != 0)
//handle_error_en(s, "pthread_create");
s = pthread_create(&thread_ceva, NULL, &ceva_thread, NULL);
if (s != 0)
handle_error_en(s, "pthread_create");
//test();
while(1)
{
s = sigwait(&set, &sig);
if (s != 0)
handle_error_en(s, "sigwait");
printf("[main] Signal handling thread got signal %d\n", sig);
}