Lines Matching refs:interpreters
78 runtime->interpreters.mutex = PyThread_allocate_lock(); in _PyRuntimeState_Init_impl()
79 if (runtime->interpreters.mutex == NULL) { in _PyRuntimeState_Init_impl()
82 runtime->interpreters.next_id = -1; in _PyRuntimeState_Init_impl()
127 FREE_LOCK(runtime->interpreters.mutex); in _PyRuntimeState_Fini()
149 int reinit_interp = _PyThread_at_fork_reinit(&runtime->interpreters.mutex); in _PyRuntimeState_ReInitThreads()
157 int reinit_main_id = _PyThread_at_fork_reinit(&runtime->interpreters.main->id_mutex); in _PyRuntimeState_ReInitThreads()
172 PyThread_acquire_lock((runtime)->interpreters.mutex, WAIT_LOCK)
174 PyThread_release_lock((runtime)->interpreters.mutex)
183 struct pyinterpreters *interpreters = &runtime->interpreters; in _PyInterpreterState_Enable() local
184 interpreters->next_id = 0; in _PyInterpreterState_Enable()
188 if (interpreters->mutex == NULL) { in _PyInterpreterState_Enable()
194 interpreters->mutex = PyThread_allocate_lock(); in _PyInterpreterState_Enable()
198 if (interpreters->mutex == NULL) { in _PyInterpreterState_Enable()
244 struct pyinterpreters *interpreters = &runtime->interpreters; in PyInterpreterState_New() local
247 if (interpreters->next_id < 0) { in PyInterpreterState_New()
257 interp->id = interpreters->next_id; in PyInterpreterState_New()
258 interpreters->next_id += 1; in PyInterpreterState_New()
259 interp->next = interpreters->head; in PyInterpreterState_New()
260 if (interpreters->main == NULL) { in PyInterpreterState_New()
261 interpreters->main = interp; in PyInterpreterState_New()
263 interpreters->head = interp; in PyInterpreterState_New()
381 struct pyinterpreters *interpreters = &runtime->interpreters; in PyInterpreterState_Delete() local
391 for (p = &interpreters->head; ; p = &(*p)->next) { in PyInterpreterState_Delete()
404 if (interpreters->main == interp) { in PyInterpreterState_Delete()
405 interpreters->main = NULL; in PyInterpreterState_Delete()
406 if (interpreters->head != NULL) { in PyInterpreterState_Delete()
428 struct pyinterpreters *interpreters = &runtime->interpreters; in _PyInterpreterState_DeleteExceptMain() local
431 if (tstate != NULL && tstate->interp != interpreters->main) { in _PyInterpreterState_DeleteExceptMain()
436 PyInterpreterState *interp = interpreters->head; in _PyInterpreterState_DeleteExceptMain()
437 interpreters->head = NULL; in _PyInterpreterState_DeleteExceptMain()
439 if (interp == interpreters->main) { in _PyInterpreterState_DeleteExceptMain()
440 interpreters->main->next = NULL; in _PyInterpreterState_DeleteExceptMain()
441 interpreters->head = interp; in _PyInterpreterState_DeleteExceptMain()
457 if (interpreters->head == NULL) { in _PyInterpreterState_DeleteExceptMain()
493 PyInterpreterState *interp = runtime->interpreters.head; in interp_look_up_id()
1168 return _PyRuntime.interpreters.head; in PyInterpreterState_Head()
1174 return _PyRuntime.interpreters.main; in PyInterpreterState_Main()
1219 for (i = runtime->interpreters.head; i != NULL; i = i->next) { in _PyThread_CurrentFrames()
1272 for (i = runtime->interpreters.head; i != NULL; i = i->next) { in _PyThread_CurrentExceptions()