Backout changeset 46393019b650

test_capi is failing and the fix is not trivial, I prefer to revert
This commit is contained in:
Victor Stinner 2013-12-13 04:14:41 +01:00
parent 775632ba10
commit 441adb8c57
7 changed files with 30 additions and 24 deletions

View file

@ -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;