diff options
author | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2010-09-20 02:11:49 (GMT) |
---|---|---|
committer | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2010-09-20 02:11:49 (GMT) |
commit | 2fea9b961d6ea1041ace66037513fcad1fc2173d (patch) | |
tree | b01a6295a2711f72c1a2b5ce94fbfc0372636fc7 /Python/thread_nt.h | |
parent | 3d8580f690d13817af941afe4958576e8d7922af (diff) | |
download | cpython-2fea9b961d6ea1041ace66037513fcad1fc2173d.zip cpython-2fea9b961d6ea1041ace66037513fcad1fc2173d.tar.gz cpython-2fea9b961d6ea1041ace66037513fcad1fc2173d.tar.bz2 |
issue 9786 Native TLS support for pthreads
PyThread_create_key now has a failure mode that the applicatino can detect.
Diffstat (limited to 'Python/thread_nt.h')
-rw-r--r-- | Python/thread_nt.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/thread_nt.h b/Python/thread_nt.h index 2fd7098..9de9e0d 100644 --- a/Python/thread_nt.h +++ b/Python/thread_nt.h @@ -315,7 +315,10 @@ _pythread_nt_set_stacksize(size_t size) int PyThread_create_key(void) { - return (int) TlsAlloc(); + DWORD result= TlsAlloc(); + if (result == TLS_OUT_OF_INDEXES) + return -1; + return (int)result; } void |