mirror of
https://github.com/python/cpython.git
synced 2025-08-25 03:04:55 +00:00
gh-104530: Enable native Win32 condition variables by default (GH-104531)
This commit is contained in:
parent
d29f57f603
commit
b3f0b698da
6 changed files with 41 additions and 35 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue