mirror of
https://github.com/sigmasternchen/CFloor
synced 2025-03-15 20:28:56 +00:00
I forgot to start the cleanup thread
This commit is contained in:
parent
b39fb7bcd8
commit
a691fb05a2
1 changed files with 9 additions and 1 deletions
|
@ -1122,7 +1122,7 @@ void* listenThread(void* _bind) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cleanupThread() {
|
void* cleanupThread(void* _) {
|
||||||
while(true) {
|
while(true) {
|
||||||
if (signal_wait(SIGALRM) != 0) {
|
if (signal_wait(SIGALRM) != 0) {
|
||||||
error("networking: clean up thread: sigwait: %s", strerror(errno));
|
error("networking: clean up thread: sigwait: %s", strerror(errno));
|
||||||
|
@ -1141,6 +1141,14 @@ void networking_init(struct networkingConfig _networkingConfig) {
|
||||||
|
|
||||||
signal_block(SIGIO);
|
signal_block(SIGIO);
|
||||||
signal_block(SIGALRM);
|
signal_block(SIGALRM);
|
||||||
|
|
||||||
|
// in case a pipe breaks
|
||||||
|
signal_block(SIGPIPE);
|
||||||
|
|
||||||
|
if (pthread_create(&dataThreadId, NULL, &cleanupThread, NULL) != 0) {
|
||||||
|
critical("networking: Couldn't start data thread.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
timer_t timer = timer_createSignalTimer(SIGALRM);
|
timer_t timer = timer_createSignalTimer(SIGALRM);
|
||||||
if (timer == NULL) {
|
if (timer == NULL) {
|
||||||
|
|
Loading…
Reference in a new issue