summaryrefslogtreecommitdiff
path: root/Python/thread_pthread.h
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-12-13 04:14:41 +0100
committerVictor Stinner <victor.stinner@gmail.com>2013-12-13 04:14:41 +0100
commit85178aa8d643e098eeb3d1314194316369b49846 (patch)
tree0a5f32480083e00871ebc81123a615fbeae63fc4 /Python/thread_pthread.h
parentcb588ebd972405b416e626d1f26b26563b68d2c9 (diff)
downloadcpython-85178aa8d643e098eeb3d1314194316369b49846.tar.gz
Backout changeset 46393019b650
test_capi is failing and the fix is not trivial, I prefer to revert
Diffstat (limited to 'Python/thread_pthread.h')
-rw-r--r--Python/thread_pthread.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h
index d9f7c76f2a..20f8535896 100644
--- a/Python/thread_pthread.h
+++ b/Python/thread_pthread.h
@@ -627,6 +627,9 @@ int
PyThread_set_key_value(int key, void *value)
{
int fail;
+ void *oldValue = pthread_getspecific(key);
+ if (oldValue != NULL)
+ return 0;
fail = pthread_setspecific(key, value);
return fail ? -1 : 0;
}