mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-19 04:57:53 +00:00
Build fix.
This commit is contained in:
parent
414c248cc5
commit
f934a09baa
@ -185,7 +185,7 @@ LinuxEthernetTap::LinuxEthernetTap(
|
||||
(void)::pipe(_shutdownSignalPipe);
|
||||
|
||||
for(unsigned int t=0;t<2;++t) {
|
||||
_tapReaderThread = std::thread([this, t]{
|
||||
_tapReaderThread[t] = std::thread([this, t]{
|
||||
fd_set readfds,nullfds;
|
||||
int n,nfds,r;
|
||||
void *buf = nullptr;
|
||||
@ -324,14 +324,15 @@ LinuxEthernetTap::LinuxEthernetTap(
|
||||
|
||||
LinuxEthernetTap::~LinuxEthernetTap()
|
||||
{
|
||||
(void)::write(_shutdownSignalPipe[1],"\0",1); // causes reader thread to exit
|
||||
(void)::write(_shutdownSignalPipe[1],"\0",1); // causes reader thread(s) to exit
|
||||
_tapq.post(std::pair<void *,int>(nullptr,0)); // causes processor thread to exit
|
||||
|
||||
::close(_fd);
|
||||
::close(_shutdownSignalPipe[0]);
|
||||
::close(_shutdownSignalPipe[1]);
|
||||
|
||||
_tapReaderThread.join();
|
||||
_tapReaderThread[0].join();
|
||||
_tapReaderThread[1].join();
|
||||
_tapProcessorThread.join();
|
||||
|
||||
for(std::vector<void *>::iterator i(_buffers.begin());i!=_buffers.end();++i)
|
||||
|
@ -70,7 +70,7 @@ private:
|
||||
int _fd;
|
||||
int _shutdownSignalPipe[2];
|
||||
std::atomic_bool _enabled;
|
||||
std::thread _tapReaderThread;
|
||||
std::thread _tapReaderThread[2];
|
||||
std::thread _tapProcessorThread;
|
||||
std::mutex _buffers_l;
|
||||
std::vector<void *> _buffers;
|
||||
|
Loading…
Reference in New Issue
Block a user