summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorbobince <and+github@doxdesk.com>2020-03-11 23:39:02 (GMT)
committerGitHub <noreply@github.com>2020-03-11 23:39:02 (GMT)
commit64838ce7172c7a92183b39b22504b433a33a884d (patch)
tree338cc53731fe3ad3f524209ab33d6ebe91d3caa8 /Misc
parent894adc18b4fb7246b762276a50a332c0e4f0e0f0 (diff)
downloadcpython-64838ce7172c7a92183b39b22504b433a33a884d.zip
cpython-64838ce7172c7a92183b39b22504b433a33a884d.tar.gz
cpython-64838ce7172c7a92183b39b22504b433a33a884d.tar.bz2
bpo-39847: EnterNonRecursiveMutex() uses GetTickCount64() (GH-18780)
The 32-bit (49-day) TickCount relied on in EnterNonRecursiveMutex can overflow in the gap between the 'target' time and the 'now' time WaitForSingleObjectEx returns, causing the loop to think it needs to wait another 49 days. This is most likely to happen when the machine is hibernated during WaitForSingleObjectEx. This makes acquiring a lock/event/etc from the _thread or threading module appear to never timeout. Replace with GetTickCount64 - this is OK now Python no longer supports XP which lacks it, and is in use for time.monotonic(). Co-authored-by: And Clover <and.clover@bromium.com>
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Windows/2020-03-04-17-05-11.bpo-39847.C3N2m3.rst2
1 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Windows/2020-03-04-17-05-11.bpo-39847.C3N2m3.rst b/Misc/NEWS.d/next/Windows/2020-03-04-17-05-11.bpo-39847.C3N2m3.rst
new file mode 100644
index 0000000..acfbce5
--- /dev/null
+++ b/Misc/NEWS.d/next/Windows/2020-03-04-17-05-11.bpo-39847.C3N2m3.rst
@@ -0,0 +1,2 @@
+Avoid hang when computer is hibernated whilst waiting for a mutex (for
+lock-related objects from :mod:`threading`) around 49-day uptime.