signal_handler: increase alarm timeout to 5s and use raise instead of exit()

it seems that exit() causes problems when threads couldn't be stopped
properly, which is the reason why we have to call alarm() in the first place.
therefore, send a SIGKILL to our process and make sure we don't leave any
zombie threads running.
master
Andre Puschmann 5 years ago
parent d69aa55a42
commit 057844d7d6

@ -35,7 +35,7 @@
extern "C" { extern "C" {
#endif // __cplusplus #endif // __cplusplus
#define SRSLTE_TERM_TIMEOUT_S (3) #define SRSLTE_TERM_TIMEOUT_S (5)
// static vars required by signal handling // static vars required by signal handling
static srslte::logger_file logger_file; static srslte::logger_file logger_file;
@ -47,7 +47,7 @@ static void srslte_signal_handler(int signal)
case SIGALRM: case SIGALRM:
fprintf(stderr, "Couldn't stop after %ds. Forcing exit.\n", SRSLTE_TERM_TIMEOUT_S); fprintf(stderr, "Couldn't stop after %ds. Forcing exit.\n", SRSLTE_TERM_TIMEOUT_S);
logger_file.stop(); logger_file.stop();
exit(-1); raise(SIGKILL);
default: default:
// all other registered signals try to stop the app gracefully // all other registered signals try to stop the app gracefully
if (running) { if (running) {

Loading…
Cancel
Save