Commit a50b55be authored by Stefan Reif's avatar Stefan Reif

Use the closing flag in the cleaner thread

This ensures that the cleaner runs right before it terminates.
parent 07c3d7bc
Pipeline #898 failed with stages
in 2 minutes and 16 seconds
#include <unistd.h>
#include <stdatomic.h>
#include "../socket.h"
#include"../../util/dbg.h"
#include "cleaner.h"
......@@ -38,6 +39,8 @@ void *cleanup(void *ptr)
}
}
if (!atomic_load_explicit(&socket->closing, memory_order_acquire))
break;
usleep(1000000);
}
......
......@@ -204,7 +204,6 @@ int PrrtSocket_interrupt(PrrtSocket *sock_ptr) {
}
if(sock_ptr->cleanupThread != 0) {
check(pthread_cancel(sock_ptr->cleanupThread) == 0, "Cancel failed.");
check(pthread_join(sock_ptr->cleanupThread, res) == 0, "Join failed.");
sock_ptr->cleanupThread = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment