c - does signal handler code block the main process? -
c - does signal handler code block the main process? -
i registering alarm signal handler follows , alarm signal set every second.
sigact.sa_handler = time_handler; sigemptyset(&sigact.sa_mask); sigact.sa_flags = sa_restart; if (sigaction(sigalrm, &sigact, null) < 0) panic("sigaction sigalrm: %s\n", strerror(errno)); /* set alarm signal every sec */ alarm(1);
my question function time_handler
follow separate execution path thread or block main process.
you can find out if using gnu c adding sleep() phone call in callback, , seeing if code afterwards delayed.
c timer
Comments
Post a Comment