atari83 commented on issue #198:
URL: 
https://github.com/apache/logging-log4cxx/issues/198#issuecomment-1564730533

   Robert, Thank you very much for your responses and following up this case 
with me.
   
   Regarding to using sigmask, I'm still confused ... This is my current 
implementation in my main for catching signals:
   
   ```
        sigset_t ss;
        sigemptyset(&ss);
   
        sigaddset(&ss, SIGTERM);
        sigaddset(&ss, SIGINT);
        sigaddset(&ss, SIGUSR1);
        sigaddset(&ss, SIGUSR2);
   
        /* I've initially set the mask-mode to SIG_SETMASK, but same result 
when SIG_BLOCK is used */
        pthread_sigmask( /*SIG_SETMASK*/ SIG_BLOCK, &ss, NULL );
   
        while (1) {
                int sig, *ps;
                sigwait(&ss, &sig);
   
                switch (sig) {
                        case SIGUSR1:
                        case SIGUSR2:
                                // Here is where I create detached thread to 
process the event.
                                break;
   
                        case SIGINT:
                        case SIGTERM:
                                shutdown_func();
                                break;
   
                }
        }
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to