Commit 674ef1db authored by Jan Včelák's avatar Jan Včelák 🚀

dthreads: start new threads with all signals blocked

parent 13bed46f
......@@ -123,7 +123,7 @@ static void *thread_ep(void *data)
return 0;
}
// Unblock SIGALRM
// Unblock SIGALRM for synchronization
sigset_t mask;
(void)sigemptyset(&mask);
sigaddset(&mask, SIGALRM);
......@@ -458,10 +458,14 @@ static int dt_start_id(dthread_t *thread)
}
// Start thread
sigset_t mask_all, mask_old;
sigfillset(&mask_all);
pthread_sigmask(SIG_SETMASK, &mask_all, &mask_old);
int res = pthread_create(&thread->_thr, /* pthread_t */
&thread->_attr, /* pthread_attr_t */
thread_ep, /* routine: thread_ep */
thread); /* passed object: dthread_t */
pthread_sigmask(SIG_SETMASK, &mask_old, NULL);
// Unlock thread
unlock_thread_rw(thread);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment