October 2018
Beginner
794 pages
19h 23m
English
A quick demonstration of the POSIX recommended technique for handling signals in an MT application follows (ch16/tsig.c):
// ... in main:/* Block *all* signals here in the main thread. * Now all subsequently created threads also block all signals. */ sigfillset(&sigset); if (pthread_sigmask(SIG_BLOCK, &sigset, NULL)) FATAL("main: pthread_sigmask failed");... /*--- Create the dedicated signal handling thread ---*/ ret = pthread_create(&pthrd[t], &attr, ...Read now
Unlock full access