We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
workbranch br(2); auto result = br.submit([](){ return xx; }); if(result.wait_for(xx) == std::future::time_out){ // 请问一下 如过超时,如何杀掉执行当前超时任务的线程。 }else{ result.get(); }
请问一下 如过超时,如何杀掉执行当前超时任务的线程。
The text was updated successfully, but these errors were encountered:
线程不能随便杀掉。尽量确保不要有阻塞任务,也可以折中地用动态增加线程来解决。
Sorry, something went wrong.
这里wait_for可以指定一段时间,可以确保主线程不会因为异步线程而阻塞。
No branches or pull requests
请问一下 如过超时,如何杀掉执行当前超时任务的线程。
The text was updated successfully, but these errors were encountered: