PCAP: Don't use pthread_cancel on Linux

It is not necessary and can cause a crash in libunwind
This commit is contained in:
Paul Hollinsky
2021-12-08 14:30:02 -05:00
parent d5087c1ba5
commit 96f18dcfd6
+2
View File
@@ -259,7 +259,9 @@ bool PCAP::close() {
closing = true; // Signal the threads that we are closing closing = true; // Signal the threads that we are closing
pcap_breakloop(iface.fp); pcap_breakloop(iface.fp);
#ifndef __linux__
pthread_cancel(readThread.native_handle()); pthread_cancel(readThread.native_handle());
#endif
readThread.join(); readThread.join();
writeThread.join(); writeThread.join();
closing = false; closing = false;