Changeset View
Changeset View
Standalone View
Standalone View
src/httpserver.cpp
Show First 20 Lines • Show All 134 Lines • ▼ Show 20 Lines | public: | ||||
} | } | ||||
/** Wait for worker threads to exit */ | /** Wait for worker threads to exit */ | ||||
void WaitExit() { | void WaitExit() { | ||||
std::unique_lock<std::mutex> lock(cs); | std::unique_lock<std::mutex> lock(cs); | ||||
while (numThreads > 0) | while (numThreads > 0) | ||||
cond.wait(lock); | cond.wait(lock); | ||||
} | } | ||||
/** Return current depth of queue */ | |||||
size_t Depth() { | |||||
std::unique_lock<std::mutex> lock(cs); | |||||
return queue.size(); | |||||
} | |||||
}; | }; | ||||
struct HTTPPathHandler { | struct HTTPPathHandler { | ||||
HTTPPathHandler() {} | HTTPPathHandler() {} | ||||
HTTPPathHandler(std::string _prefix, bool _exactMatch, | HTTPPathHandler(std::string _prefix, bool _exactMatch, | ||||
HTTPRequestHandler _handler) | HTTPRequestHandler _handler) | ||||
: prefix(_prefix), exactMatch(_exactMatch), handler(_handler) {} | : prefix(_prefix), exactMatch(_exactMatch), handler(_handler) {} | ||||
std::string prefix; | std::string prefix; | ||||
▲ Show 20 Lines • Show All 519 Lines • Show Last 20 Lines |