Fix build error for BSD tap driver

This commit is contained in:
Joseph Henry 2024-09-17 11:04:01 -07:00 committed by GitHub
parent 4920b68d2c
commit d34481d830
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -431,10 +431,12 @@ void BSDEthernetTap::threadMain()
// constructing itself.
Thread::sleep(500);
for (unsigned int i = 0; i < _concurrency; ++i) {
_rxThreads.push_back(std::thread([this, i, _pinning] {
bool pinning = _pinning;
if (_pinning) {
for (unsigned int i = 0; i < _concurrency; ++i) {
_rxThreads.push_back(std::thread([this, i, pinning] {
if (pinning) {
int pinCore = i % _concurrency;
fprintf(stderr, "Pinning thread %d to core %d\n", i, pinCore);
pthread_t self = pthread_self();