mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-06 01:48:37 +02:00
POSIX: PCAP: Cancel after pcap_breakloop() to EINTR out of poll()
This is necessary as pcap_breakloop() does not actually wake the thread from blocking operations, such as poll.
This commit is contained in:
@@ -234,6 +234,7 @@ bool PCAP::close() {
|
|||||||
|
|
||||||
closing = true; // Signal the threads that we are closing
|
closing = true; // Signal the threads that we are closing
|
||||||
pcap_breakloop(interface.fp);
|
pcap_breakloop(interface.fp);
|
||||||
|
pthread_cancel(readThread.native_handle());
|
||||||
readThread.join();
|
readThread.join();
|
||||||
writeThread.join();
|
writeThread.join();
|
||||||
closing = false;
|
closing = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user