Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 May 2009 17:32:45 -0700 (PDT)
From:      Peter Steele <psteele@maxiscale.com>
To:        #freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: Why would a kill -2 not work?
Message-ID:  <25097232.1021242693162151.JavaMail.HALO$@halo>
In-Reply-To: <70C0964126D66F458E688618E1CD008A0793ED2E@WADPEXV0.waddell.com>

next in thread | previous in thread | raw e-mail | index | archive | help
>You're not trying to send a signal within the signal handler itself, 
>are you? That won't work-- signal delivery is blocked when you're 
>already running in a signal handler. Also, note that trying to mix 
>signals with a multithreaded process is complicated.... 

No, I'm not sending a signal within a signal. The signal handler is this: 

pthread_mutex_lock(&keep_running_mutex); 
KEEP_RUNNING = 0; 
pthread_cond_signal(&keep_running_cond); 
pthread_mutex_unlock(&keep_running_mutex); 

This works fine, but at some point it seems to stop working. The app just continues to run as if it never received the -2 signal. We have to use a kill -9 to kill it, which we want to avoid because this prevents our shutdown code from executing. 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?25097232.1021242693162151.JavaMail.HALO$>