-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Description
Right now I can only tell that my application sometimes doesn't end because tlog_exit() doesn't return.
If I find a simple code to reproduce it, I will add it here, of course...
The simplified pseudo code looks like that:
void signal_handler( signal ) {case {SIGINT, SIGTERM: server_stop = 1;} }
void *thread() { while (server_stop != 1) { do stuff; tlog(somtehing); }
main() {
signal(SIGINT, handle_signal);
signal(SIGTERM, handle_signal);
tlog_init(logfile, 1M, 4, 0, TLOG_SCREEN_COLOR);
for (i = 0 .. N) {
pthread_create(thread);
}
while (server_stop != 1) { do something; sleep() }
for (i = 0 .. N) {
pthread_join(thread);
}
tlog("DONE");
tlog_exit();
}
lsof -t /path/to/logfile shows that the process still has the file open.
Metadata
Metadata
Assignees
Labels
No labels