From 3712f9b318dc3a47b97bcc717266c4c0b100d4f8 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 18 Nov 2020 22:24:09 -0500 Subject: [PATCH] Revert "Shutdown fix." This reverts commit 11545bdb5d37b2df26fc5fdd00cadd05878de094. --- osdep/LinuxEthernetTap.cpp | 8 ++------ osdep/LinuxEthernetTap.hpp | 1 - 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/osdep/LinuxEthernetTap.cpp b/osdep/LinuxEthernetTap.cpp index ad96eb9e..4659df55 100644 --- a/osdep/LinuxEthernetTap.cpp +++ b/osdep/LinuxEthernetTap.cpp @@ -92,8 +92,7 @@ LinuxEthernetTap::LinuxEthernetTap( _homePath(homePath), _mtu(mtu), _fd(0), - _enabled(true), - _running(true) + _enabled(true) { static std::mutex s_tapCreateLock; char procpath[128],nwids[32]; @@ -268,7 +267,7 @@ LinuxEthernetTap::LinuxEthernetTap( r = 0; } - } else if ((errno != EINTR)||(!_running.load())) { + } else { r = 0; break; } @@ -298,12 +297,9 @@ LinuxEthernetTap::LinuxEthernetTap( LinuxEthernetTap::~LinuxEthernetTap() { - _running = false; - _tapq.post(std::pair(nullptr,0)); ::shutdown(_fd, SHUT_RDWR); ::close(_fd); - pthread_kill(_tapReaderThread.native_handle(), SIGUSR1); _tapReaderThread.join(); _tapProcessorThread.join(); diff --git a/osdep/LinuxEthernetTap.hpp b/osdep/LinuxEthernetTap.hpp index 771b2798..f296ec69 100644 --- a/osdep/LinuxEthernetTap.hpp +++ b/osdep/LinuxEthernetTap.hpp @@ -69,7 +69,6 @@ private: unsigned int _mtu; int _fd; std::atomic_bool _enabled; - std::atomic_bool _running; std::thread _tapReaderThread; std::thread _tapProcessorThread; std::mutex _buffers_l;