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
#include "co/co.h" #include "co/log.h" #include "co/time.h" co::Event ev; DEF_bool(wait_alway, true, "false: wait for timeout, true wait alway"); void f2(){ CLOG << "f2() start"; bool r = true; if (FLG_wait_alway) { ev.wait(); } else { r = ev.wait(1*1000); } CLOG << "f2() end: " << r; } void f3() { CLOG << "f3() start"; ev.signal(); CLOG << "f3() end"; } int main(int argc, char** argv) { flag::init(argc, argv); log::init(); go(f2); sleep::ms(100); go(f3); sleep::ms(2*1000); return 0; }
运行结果1: ./test wait_alway=false
f2() start f3() start f3() end f2() end: true
运行结果1: ./test wait_alway=true
f2() start f3() start f3() end
The text was updated successfully, but these errors were encountered:
0b7d5fb
Merge pull request #84 from idealvin/dev
fa20cc3
fix #83
@mosxuqian 感谢反馈,已修复. 上次重构时,少打了一个 & 符号. 详情参考 commit fa20cc3ad...
&
Sorry, something went wrong.
No branches or pull requests
运行结果1:
./test wait_alway=false
运行结果1:
./test wait_alway=true
The text was updated successfully, but these errors were encountered: