summaryrefslogtreecommitdiffstats
path: root/Python/thread_nt.h
diff options
context:
space:
mode:
authorAndrew Rogers <32688592+adr26@users.noreply.github.com>2024-02-02 13:50:51 (GMT)
committerGitHub <noreply@github.com>2024-02-02 13:50:51 (GMT)
commitb3f0b698daf2438a6e59d5d19ccb34acdba0bffc (patch)
treec13e5926d093a35c2e7b63b525af2ef5b4733fe3 /Python/thread_nt.h
parentd29f57f6036353b4e705a42637177442bf7e07e5 (diff)
downloadcpython-b3f0b698daf2438a6e59d5d19ccb34acdba0bffc.zip
cpython-b3f0b698daf2438a6e59d5d19ccb34acdba0bffc.tar.gz
cpython-b3f0b698daf2438a6e59d5d19ccb34acdba0bffc.tar.bz2
gh-104530: Enable native Win32 condition variables by default (GH-104531)
Diffstat (limited to 'Python/thread_nt.h')
-rw-r--r--Python/thread_nt.h22
1 files changed, 2 insertions, 20 deletions
diff --git a/Python/thread_nt.h b/Python/thread_nt.h
index 14b9cdd..044e9fa 100644
--- a/Python/thread_nt.h
+++ b/Python/thread_nt.h
@@ -444,16 +444,7 @@ PyThread_set_key_value(int key, void *value)
void *
PyThread_get_key_value(int key)
{
- /* because TLS is used in the Py_END_ALLOW_THREAD macro,
- * it is necessary to preserve the windows error state, because
- * it is assumed to be preserved across the call to the macro.
- * Ideally, the macro should be fixed, but it is simpler to
- * do it here.
- */
- DWORD error = GetLastError();
- void *result = TlsGetValue(key);
- SetLastError(error);
- return result;
+ return TlsGetValue(key);
}
void
@@ -525,14 +516,5 @@ void *
PyThread_tss_get(Py_tss_t *key)
{
assert(key != NULL);
- /* because TSS is used in the Py_END_ALLOW_THREAD macro,
- * it is necessary to preserve the windows error state, because
- * it is assumed to be preserved across the call to the macro.
- * Ideally, the macro should be fixed, but it is simpler to
- * do it here.
- */
- DWORD error = GetLastError();
- void *result = TlsGetValue(key->_key);
- SetLastError(error);
- return result;
+ return TlsGetValue(key->_key);
}