Open objects76 opened 5 years ago
When rpc_server shutdown, it takes 15 sec(checkseconds value) at worst case.
So,... How about using condition_variable wait for instead of this_thread::sleep.
`~rpc_server() { stopcheck = true; cleansig.notify_one(); checkthread->join();
void clean() { while (!stopcheck) { //std::this_thread::sleep_for(std::chrono::seconds(checkseconds)); std::uniquelock lock(mtx); cleansig.wait_for(lock, std::chrono::seconds(checkseconds));`
That's true. Feel free to make a pr.
I have solved the problem, no need waiting 15 seconds any more.
When rpc_server shutdown, it takes 15 sec(checkseconds value) at worst case.
So,... How about using condition_variable wait for instead of this_thread::sleep.
`~rpc_server() { stopcheck = true; cleansig.notify_one(); checkthread->join();
void clean() { while (!stopcheck) { //std::this_thread::sleep_for(std::chrono::seconds(checkseconds)); std::uniquelock lock(mtx );
cleansig.wait_for(lock, std::chrono::seconds(checkseconds));`