httpserver: explicitly detach worker threads
When using std::thread in place of boost::thread, letting the threads destruct results in a std::terminate. According to the docs, the same thing should be be happening in later boost versions: http://www.boost.org/doc/libs/1_55_0/doc/html/thread/thread_management.html#thread.thread_management.thread.destructor I'm unsure why this hasn't blown up already, but explicitly detaching can't hurt.
This commit is contained in:
parent
755aa05174
commit
d3773ca9ae
1 changed files with 4 additions and 2 deletions
|
@ -451,8 +451,10 @@ bool StartHTTPServer()
|
||||||
threadResult = task.get_future();
|
threadResult = task.get_future();
|
||||||
threadHTTP = boost::thread(std::bind(std::move(task), eventBase, eventHTTP));
|
threadHTTP = boost::thread(std::bind(std::move(task), eventBase, eventHTTP));
|
||||||
|
|
||||||
for (int i = 0; i < rpcThreads; i++)
|
for (int i = 0; i < rpcThreads; i++) {
|
||||||
boost::thread(boost::bind(&HTTPWorkQueueRun, workQueue));
|
boost::thread rpc_worker(HTTPWorkQueueRun, workQueue);
|
||||||
|
rpc_worker.detach();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue