remove mutexes

pull/962/head
Jeff Becker 5 years ago
parent 85e911fed0
commit f259cca0ba
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -152,13 +152,11 @@ tun_ev_loop(void* u)
// of the tun logic // of the tun logic
for(const auto& tun : tun_listeners) for(const auto& tun : tun_listeners)
{ {
EnterCriticalSection(&HandlerMtx);
logic->call_soon([tun]() { logic->call_soon([tun]() {
if(tun->t->tick) if(tun->t->tick)
tun->t->tick(tun->t); tun->t->tick(tun->t);
tun->flush_write(); tun->flush_write();
}); });
LeaveCriticalSection(&HandlerMtx);
} }
continue; // let's go at it once more continue; // let's go at it once more
} }
@ -194,13 +192,11 @@ tun_ev_loop(void* u)
ev->read(ev->readbuf, sizeof(ev->readbuf)); ev->read(ev->readbuf, sizeof(ev->readbuf));
// LeaveCriticalSection(&HandlerMtx); // LeaveCriticalSection(&HandlerMtx);
} }
EnterCriticalSection(&HandlerMtx);
logic->call_soon([ev]() { logic->call_soon([ev]() {
if(ev->t->tick) if(ev->t->tick)
ev->t->tick(ev->t); ev->t->tick(ev->t);
ev->flush_write(); ev->flush_write();
}); });
LeaveCriticalSection(&HandlerMtx);
} }
llarp::LogDebug("exit TUN event loop thread from system managed thread pool"); llarp::LogDebug("exit TUN event loop thread from system managed thread pool");
return 0; return 0;

Loading…
Cancel
Save