diff options
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 2fd709817c..9de9e0dfbe 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 |