mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
cleanup
This commit is contained in:
parent
4a89729529
commit
f6e9f0e2a2
1 changed files with 1 additions and 4 deletions
|
@ -607,16 +607,13 @@ public:
|
||||||
_ports[1] = 0;
|
_ports[1] = 0;
|
||||||
_ports[2] = 0;
|
_ports[2] = 0;
|
||||||
|
|
||||||
|
_incomingPacketConcurrency = std::max((unsigned long)1,std::min((unsigned long)16,(unsigned long)std::thread::hardware_concurrency()));
|
||||||
char *envPool = std::getenv("INCOMING_PACKET_CONCURRENCY");
|
char *envPool = std::getenv("INCOMING_PACKET_CONCURRENCY");
|
||||||
if (envPool != NULL) {
|
if (envPool != NULL) {
|
||||||
int tmp = atoi(envPool);
|
int tmp = atoi(envPool);
|
||||||
if (tmp > 0) {
|
if (tmp > 0) {
|
||||||
_incomingPacketConcurrency = tmp;
|
_incomingPacketConcurrency = tmp;
|
||||||
} else {
|
|
||||||
_incomingPacketConcurrency = std::max((unsigned long)1,std::min((unsigned long)16,(unsigned long)std::thread::hardware_concurrency()));
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
_incomingPacketConcurrency = std::max((unsigned long)1,std::min((unsigned long)16,(unsigned long)std::thread::hardware_concurrency()));
|
|
||||||
}
|
}
|
||||||
for(long t=0;t<_incomingPacketConcurrency;++t) {
|
for(long t=0;t<_incomingPacketConcurrency;++t) {
|
||||||
_incomingPacketThreads.push_back(std::thread([this]() {
|
_incomingPacketThreads.push_back(std::thread([this]() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue