g_log<<Logger::Warning<<"About to create "<<numberOfThreads<<" backend threads for UDP"<<endl;
for (int distributorIdx = 0; distributorIdx < numberOfThreads; distributorIdx++) {
- std::thread t([=](){distribute(distributorIdx);});
+ std::thread t([=,this](){distribute(distributorIdx);});
t.detach();
Utility::usleep(50000); // we've overloaded mysql in the past :-)
}
}
void WebServer::registerApiHandler(const string& url, const HandlerFunction& handler, const std::string& method, bool allowPassword) {
- auto f = [=](HttpRequest *req, HttpResponse* resp){apiWrapper(handler, req, resp, allowPassword);};
+ auto f = [=,this](HttpRequest *req, HttpResponse* resp){apiWrapper(handler, req, resp, allowPassword);};
registerBareHandler(url, f, method);
}
}
void WebServer::registerWebHandler(const string& url, const HandlerFunction& handler, const std::string& method) {
- auto f = [=](HttpRequest *req, HttpResponse *resp){webWrapper(handler, req, resp);};
+ auto f = [=,this](HttpRequest *req, HttpResponse *resp){webWrapper(handler, req, resp);};
registerBareHandler(url, f, method);
}