mirror of
https://github.com/python/cpython.git
synced 2025-09-09 18:32:22 +00:00
issue 9786 Native TLS support for pthreads
PyThread_create_key now has a failure mode that the applicatino can detect.
This commit is contained in:
parent
3d8580f690
commit
2fea9b961d
3 changed files with 49 additions and 1 deletions
|
@ -569,6 +569,8 @@ _PyGILState_Init(PyInterpreterState *i, PyThreadState *t)
|
|||
{
|
||||
assert(i && t); /* must init with valid states */
|
||||
autoTLSkey = PyThread_create_key();
|
||||
if (autoTLSkey == -1)
|
||||
Py_FatalError("Could not allocate TLS entry");
|
||||
autoInterpreterState = i;
|
||||
assert(PyThread_get_key_value(autoTLSkey) == NULL);
|
||||
assert(t->gilstate_counter == 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue