-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
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
poll: Use GetTickCount64 to avoid wraparound issues #1003
Conversation
From Visual Studio 2015 Code Analysis: Warning C28159 Consider using 'GetTickCount64' instead of 'GetTickCount'. Reason: GetTickCount overflows roughly every 49 days. Code that does not take that into account can loop indefinitely. GetTickCount64 operates on 64 bit values and does not have that problem. Signed-off-by: Steve Hoelzer <shoelzer@gmail.com>
Please note that GitHub created the As to XP support: I will merge this for now, and help @linquize to get XP support back if my question ("Are you this developer?") is answered in the affirmative. |
@dscho Thanks for the tip. I'm still figuring out GitHub. |
@shoelzer no worries. @linquize I ended up having to add the XP compatibility patch anyways: 8b018c7 (it was necessary because we did not quite yet make the jump away from XP in Git for Windows' source code). It would be good of you if you could react to my comments, otherwise it really feels as if I was talking to your hand. |
Our `poll()` emulation [now uses 64-bit tick counts](git-for-windows/git#1003) to avoid the (very rare) wraparound issue where it could miscalculate time differences every 49 days. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
poll: Use GetTickCount64 to avoid wraparound issues
poll: Use GetTickCount64 to avoid wraparound issues
poll: Use GetTickCount64 to avoid wraparound issues
poll: Use GetTickCount64 to avoid wraparound issues
poll: Use GetTickCount64 to avoid wraparound issues
poll: Use GetTickCount64 to avoid wraparound issues
poll: Use GetTickCount64 to avoid wraparound issues
poll: Use GetTickCount64 to avoid wraparound issues
poll: Use GetTickCount64 to avoid wraparound issues
poll: Use GetTickCount64 to avoid wraparound issues
poll: Use GetTickCount64 to avoid wraparound issues
poll: Use GetTickCount64 to avoid wraparound issues
poll: Use GetTickCount64 to avoid wraparound issues
poll: Use GetTickCount64 to avoid wraparound issues
poll: Use GetTickCount64 to avoid wraparound issues
poll: Use GetTickCount64 to avoid wraparound issues
poll: Use GetTickCount64 to avoid wraparound issues
poll: Use GetTickCount64 to avoid wraparound issues
poll: Use GetTickCount64 to avoid wraparound issues
This was pull request git-for-windows#1003 from shoelzer/master poll: Use GetTickCount64 to avoid wraparound issues Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This was pull request #1003 from shoelzer/master poll: Use GetTickCount64 to avoid wraparound issues Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This was pull request #1003 from shoelzer/master poll: Use GetTickCount64 to avoid wraparound issues Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This was pull request #1003 from shoelzer/master poll: Use GetTickCount64 to avoid wraparound issues Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This was pull request #1003 from shoelzer/master poll: Use GetTickCount64 to avoid wraparound issues Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This was pull request git-for-windows#1003 from shoelzer/master poll: Use GetTickCount64 to avoid wraparound issues Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This was pull request #1003 from shoelzer/master poll: Use GetTickCount64 to avoid wraparound issues Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This was pull request #1003 from shoelzer/master poll: Use GetTickCount64 to avoid wraparound issues Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This was pull request #1003 from shoelzer/master poll: Use GetTickCount64 to avoid wraparound issues Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This was pull request #1003 from shoelzer/master poll: Use GetTickCount64 to avoid wraparound issues Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This replaces PR #993. I was doing that one with the GitHub website but
can't complete it there.
Note that @linquize, @PhilipOakley, and @dscho were having a discussion
about Win XP support and that should conclude before accepting this PR.
From Visual Studio 2015 Code Analysis: Warning C28159 Consider using
'GetTickCount64' instead of 'GetTickCount'.
Reason: GetTickCount overflows roughly every 49 days. Code that does not
take that into account can loop indefinitely. GetTickCount64 operates on
64 bit values and does not have that problem.
Signed-off-by: Steve Hoelzer shoelzer@gmail.com