Lines Matching refs:state
2 /* Thread and interpreter state structures and their interfaces */
265 /* Get the interpreter state to a minimal consistent state.
269 The runtime state is not manipulated. Instead it is assumed that
334 // Allocate the interpreter and add it to the runtime state.
399 // Clear the current/main thread state last.
460 // Use the current Python thread state to call audit hooks and to collect
461 // garbage. It can be different than the current Python thread state
533 * is a current interpreter state, it *must* be the main interpreter.
755 /* Get the thread state to a minimal consistent state.
759 The interpreter state is not manipulated. Instead it is assumed that
769 Py_FatalError("thread state already initialized");
810 // We don't need to allocate a thread state for the main interpreter
819 /* We serialize concurrent creation to protect global state. */
825 // Allocate the thread state and add it to the interpreter.
828 // It's the interpreter's initial thread state.
892 PyInterpreterState *state = _PyInterpreterState_GET();
899 if (state->modules_by_index == NULL)
901 if (index >= PyList_GET_SIZE(state->modules_by_index))
903 res = PyList_GET_ITEM(state->modules_by_index, index);
1149 * Note that, if there is a current thread state, it *must* be the one
1151 * than the current one, since we don't know which thread state should
1211 /* It should not be possible for more than one thread state
1223 Py_FatalError("Invalid thread state for this thread");
1236 /* An extension mechanism to store arbitrary additional per-thread state.
1238 state; the caller should pick a unique key and store its state there. If
1240 and the caller should assume no per-thread state is available. */
1501 /* Python "auto thread state" API. */
1504 ever be compared to the state for the *current* thread.
1507 possibly change to the current thread's state.
1590 /* If the thread had an associated auto thread state, reassociate it with
1601 /* When a thread state is created for a thread by some mechanism other than
1603 it so it doesn't try to create another thread state for the thread (this is
1616 /* Stick the thread state for this thread in thread specific storage.
1619 thread state for an OS level thread is when there are multiple
1625 The first thread state created for that given OS level thread will
1634 /* PyGILState_Release must not try to delete this thread state. */
1692 /* Create a new Python thread state for this thread */
1695 Py_FatalError("Couldn't create thread-state for new thread");
1698 /* This is our thread state! We'll need to delete it in the
1701 current = 0; /* new thread state is never current */
1711 /* Update our counter in the thread-state - no need for locks:
1727 Py_FatalError("auto-releasing thread-state, "
1728 "but no thread-state for this thread");
1731 /* We must hold the GIL and have our thread state current */
1738 "thread state %p must be current when releasing",
1745 /* If we're going to destroy this thread-state, we must
1752 /* Delete the thread-state. Note this releases the GIL too!