mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
Backout changeset 46393019b650
test_capi is failing and the fix is not trivial, I prefer to revert
This commit is contained in:
parent
775632ba10
commit
441adb8c57
7 changed files with 30 additions and 24 deletions
|
@ -389,11 +389,20 @@ PyThread_delete_key(int key)
|
|||
TlsFree(key);
|
||||
}
|
||||
|
||||
/* We must be careful to emulate the strange semantics implemented in thread.c,
|
||||
* where the value is only set if it hasn't been set before.
|
||||
*/
|
||||
int
|
||||
PyThread_set_key_value(int key, void *value)
|
||||
{
|
||||
BOOL ok;
|
||||
void *oldvalue;
|
||||
|
||||
assert(value != NULL);
|
||||
oldvalue = TlsGetValue(key);
|
||||
if (oldvalue != NULL)
|
||||
/* ignore value if already set */
|
||||
return 0;
|
||||
ok = TlsSetValue(key, value);
|
||||
if (!ok)
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue