Fix for another wonderful C++ threading race condition.

This commit is contained in:
Adam Ierymenko
2013-08-09 17:20:40 -04:00
parent 7c3a446499
commit 95a23dc7ec
4 changed files with 13 additions and 4 deletions

View File

@ -557,6 +557,10 @@ void EthernetTap::threadMain()
char getBuf[4096 + 14];
Buffer<4096> data;
// Wait for a moment after startup -- wait for Network to finish
// constructing itself.
Thread::sleep(500);
FD_ZERO(&readfds);
FD_ZERO(&nullfds);
int nfds = (int)std::max(_shutdownSignalPipe[0],_fd) + 1;