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
在WebServer/WebServer/Timer.cpp,第13、14行,TimerNode构造函数中: expiredTime_ = (((now.tv_sec % 10000) * 1000) + (now.tv_usec / 1000)) + timeout;
expiredTime_ = (((now.tv_sec % 10000) * 1000) + (now.tv_usec / 1000)) + timeout;
其中对now.tv_sec取了10000的模,如果我没理解错的话,在极端情况下,会出现取模后为9999,微秒刚好也是999(或者离1000很近)的情况,此时加上 timeout, expiredTime_ > 10000 * 1000,导致出现一个永远不会过期的TimerNode。请问这种情况存在吗?
The text was updated successfully, but these errors were encountered:
不好意思写错了,毫秒数为999(或者离1000很近)。而不是微秒
Sorry, something went wrong.
No branches or pull requests
在WebServer/WebServer/Timer.cpp,第13、14行,TimerNode构造函数中:
expiredTime_ = (((now.tv_sec % 10000) * 1000) + (now.tv_usec / 1000)) + timeout;
其中对now.tv_sec取了10000的模,如果我没理解错的话,在极端情况下,会出现取模后为9999,微秒刚好也是999(或者离1000很近)的情况,此时加上 timeout, expiredTime_ > 10000 * 1000,导致出现一个永远不会过期的TimerNode。请问这种情况存在吗?
The text was updated successfully, but these errors were encountered: