Home
last modified time | relevance | path

Searched refs:tstate (Results 1 – 25 of 104) sorted by relevance

12345

/external/python/cpython3/Python/
Dpystate.c44 static void _PyThreadState_Delete(PyThreadState *tstate, int check_current);
168 struct _gilstate_runtime_state *gilstate, PyThreadState* tstate);
199 PyThreadState *tstate = _PyThreadState_GET(); in PyInterpreterState_New() local
202 if (_PySys_Audit(tstate, "cpython.PyInterpreterState_New", NULL) < 0) { in PyInterpreterState_New()
238 if (tstate != NULL) { in PyInterpreterState_New()
239 _PyErr_SetString(tstate, PyExc_RuntimeError, in PyInterpreterState_New()
267 if (tstate != NULL) { in PyInterpreterState_New()
268 _PyErr_NoMemory(tstate); in PyInterpreterState_New()
283 PyThreadState *tstate = _PyThreadState_GET(); in PyInterpreterState_Clear() local
284 if (_PySys_Audit(tstate, "cpython.PyInterpreterState_Clear", NULL) < 0) { in PyInterpreterState_Clear()
[all …]
Derrors.c35 _PyErr_FormatV(PyThreadState *tstate, PyObject *exception,
40 _PyErr_Restore(PyThreadState *tstate, PyObject *type, PyObject *value, in _PyErr_Restore() argument
54 oldtype = tstate->curexc_type; in _PyErr_Restore()
55 oldvalue = tstate->curexc_value; in _PyErr_Restore()
56 oldtraceback = tstate->curexc_traceback; in _PyErr_Restore()
58 tstate->curexc_type = type; in _PyErr_Restore()
59 tstate->curexc_value = value; in _PyErr_Restore()
60 tstate->curexc_traceback = traceback; in _PyErr_Restore()
70 PyThreadState *tstate = _PyThreadState_GET(); in PyErr_Restore() local
71 _PyErr_Restore(tstate, type, value, traceback); in PyErr_Restore()
[all …]
Dpylifecycle.c59 static PyStatus init_sys_streams(PyThreadState *tstate);
60 static void call_py_exitfuncs(PyThreadState *tstate);
61 static void wait_for_thread_shutdown(PyThreadState *tstate);
142 init_importlib(PyThreadState *tstate, PyObject *sysmod) in init_importlib() argument
147 PyInterpreterState *interp = tstate->interp; in init_importlib()
184 _PyErr_Print(tstate); in init_importlib()
194 init_importlib_external(PyThreadState *tstate) in init_importlib_external() argument
197 value = PyObject_CallMethod(tstate->interp->importlib, in init_importlib_external()
200 _PyErr_Print(tstate); in init_importlib_external()
204 return _PyImportZip_Init(tstate); in init_importlib_external()
[all …]
Dceval.c49 PyThreadState *tstate, PyObject ***pp_stack,
52 PyThreadState *tstate, PyObject *func,
79 static void format_exc_unbound(PyThreadState *tstate, PyCodeObject *co, int oparg);
132 is_tstate_valid(PyThreadState *tstate) in is_tstate_valid() argument
134 assert(!_PyMem_IsPtrFreed(tstate)); in is_tstate_valid()
135 assert(!_PyMem_IsPtrFreed(tstate->interp)); in is_tstate_valid()
272 _PyEval_InitGIL(PyThreadState *tstate) in _PyEval_InitGIL() argument
274 if (!_Py_IsMainInterpreter(tstate)) { in _PyEval_InitGIL()
281 struct _gil_runtime_state *gil = &tstate->interp->runtime->ceval.gil; in _PyEval_InitGIL()
287 take_gil(tstate); in _PyEval_InitGIL()
[all …]
Dsysmodule.c65 sys_get_object_id(PyThreadState *tstate, _Py_Identifier *key) in sys_get_object_id() argument
67 PyObject *sd = tstate->interp->sysdict; in sys_get_object_id()
77 PyThreadState *tstate = _PyThreadState_GET(); in _PySys_GetObjectId() local
78 return sys_get_object_id(tstate, key); in _PySys_GetObjectId()
84 PyThreadState *tstate = _PyThreadState_GET(); in PySys_GetObject() local
85 PyObject *sd = tstate->interp->sysdict; in PySys_GetObject()
93 sys_set_object_id(PyThreadState *tstate, _Py_Identifier *key, PyObject *v) in sys_set_object_id() argument
95 PyObject *sd = tstate->interp->sysdict; in sys_set_object_id()
112 PyThreadState *tstate = _PyThreadState_GET(); in _PySys_SetObjectId() local
113 return sys_set_object_id(tstate, key, v); in _PySys_SetObjectId()
[all …]
Dceval_gil.h145 PyThreadState *tstate) in drop_gil() argument
153 if (tstate != NULL) { in drop_gil()
157 _Py_atomic_store_relaxed(&gil->last_holder, (uintptr_t)tstate); in drop_gil()
167 if (_Py_atomic_load_relaxed(&ceval2->gil_drop_request) && tstate != NULL) { in drop_gil()
170 if (((PyThreadState*)_Py_atomic_load_relaxed(&gil->last_holder)) == tstate) in drop_gil()
172 assert(is_tstate_valid(tstate)); in drop_gil()
173 RESET_GIL_DROP_REQUEST(tstate->interp); in drop_gil()
194 tstate_must_exit(PyThreadState *tstate) in tstate_must_exit() argument
201 return (finalizing != NULL && finalizing != tstate); in tstate_must_exit()
211 take_gil(PyThreadState *tstate) in take_gil() argument
[all …]
Dimport.c31 static PyObject *import_add_module(PyThreadState *tstate, PyObject *name);
55 _PyImportHooks_Init(PyThreadState *tstate) in _PyImportHooks_Init() argument
86 _PyErr_Print(tstate); in _PyImportHooks_Init()
92 _PyImportZip_Init(PyThreadState *tstate) in _PyImportZip_Init() argument
99 _PyErr_SetString(tstate, PyExc_RuntimeError, in _PyImportZip_Init()
104 int verbose = _PyInterpreterState_GetConfig(tstate->interp)->verbose; in _PyImportZip_Init()
111 _PyErr_Clear(tstate); /* No zip import module -- okay */ in _PyImportZip_Init()
122 _PyErr_Clear(tstate); /* No zipimporter object -- okay */ in _PyImportZip_Init()
173 PyThreadState *tstate = PyEval_SaveThread(); in _PyImport_AcquireLock() local
175 PyEval_RestoreThread(tstate); in _PyImport_AcquireLock()
[all …]
/external/python/cpython2/Python/
Dpystate.c53 static void _PyGILState_NoteThreadState(PyThreadState* tstate);
159 PyThreadState *tstate = (PyThreadState *)malloc(sizeof(PyThreadState)); in new_threadstate() local
164 if (tstate != NULL) { in new_threadstate()
165 tstate->interp = interp; in new_threadstate()
167 tstate->frame = NULL; in new_threadstate()
168 tstate->recursion_depth = 0; in new_threadstate()
169 tstate->tracing = 0; in new_threadstate()
170 tstate->use_tracing = 0; in new_threadstate()
171 tstate->tick_counter = 0; in new_threadstate()
172 tstate->gilstate_counter = 0; in new_threadstate()
[all …]
Dceval.c86 PyThreadState *tstate = PyThreadState_Get(); in dump_tsc() local
87 if (!tstate->interp->tscdump) in dump_tsc()
271 PyEval_AcquireThread(PyThreadState *tstate) in PyEval_AcquireThread() argument
273 if (tstate == NULL) in PyEval_AcquireThread()
278 if (PyThreadState_Swap(tstate) != NULL) in PyEval_AcquireThread()
284 PyEval_ReleaseThread(PyThreadState *tstate) in PyEval_ReleaseThread() argument
286 if (tstate == NULL) in PyEval_ReleaseThread()
288 if (PyThreadState_Swap(NULL) != tstate) in PyEval_ReleaseThread()
302 PyThreadState *tstate; in PyEval_ReInitThreads() local
317 tstate = PyThreadState_GET(); in PyEval_ReInitThreads()
[all …]
Dsysmodule.c52 PyThreadState *tstate = PyThreadState_GET(); in PySys_GetObject() local
53 PyObject *sd = tstate->interp->sysdict; in PySys_GetObject()
74 PyThreadState *tstate = PyThreadState_GET(); in PySys_SetObject() local
75 PyObject *sd = tstate->interp->sysdict; in PySys_SetObject()
152 PyThreadState *tstate; in sys_exc_info() local
153 tstate = PyThreadState_GET(); in sys_exc_info()
156 tstate->exc_type != NULL ? tstate->exc_type : Py_None, in sys_exc_info()
157 tstate->exc_value != NULL ? tstate->exc_value : Py_None, in sys_exc_info()
158 tstate->exc_traceback != NULL ? in sys_exc_info()
159 tstate->exc_traceback : Py_None); in sys_exc_info()
[all …]
Derrors.c27 PyThreadState *tstate = PyThreadState_GET(); in PyErr_Restore() local
39 oldtype = tstate->curexc_type; in PyErr_Restore()
40 oldvalue = tstate->curexc_value; in PyErr_Restore()
41 oldtraceback = tstate->curexc_traceback; in PyErr_Restore()
43 tstate->curexc_type = type; in PyErr_Restore()
44 tstate->curexc_value = value; in PyErr_Restore()
45 tstate->curexc_traceback = traceback; in PyErr_Restore()
78 PyThreadState *tstate = PyThreadState_GET(); in PyErr_Occurred() local
80 return tstate->curexc_type; in PyErr_Occurred()
151 PyThreadState *tstate = NULL; in PyErr_NormalizeException() local
[all …]
/external/python/cpython3/Include/internal/
Dpycore_ceval.h17 extern void _Py_FinishPendingCalls(PyThreadState *tstate);
26 PyAPI_FUNC(void) _PyEval_SignalAsyncExc(PyThreadState *tstate);
31 PyThreadState *tstate,
38 _PyEval_EvalFrame(PyThreadState *tstate, PyFrameObject *f, int throwflag) in _PyEval_EvalFrame() argument
40 return tstate->interp->eval_frame(tstate, f, throwflag); in _PyEval_EvalFrame()
44 PyThreadState *tstate,
54 extern PyStatus _PyEval_InitGIL(PyThreadState *tstate);
55 extern void _PyEval_FiniGIL(PyThreadState *tstate);
57 extern void _PyEval_ReleaseLock(PyThreadState *tstate);
67 static inline int _Py_MakeRecCheck(PyThreadState *tstate) { in _Py_MakeRecCheck() argument
[all …]
Dpycore_pyerrors.h11 static inline PyObject* _PyErr_Occurred(PyThreadState *tstate) in _PyErr_Occurred() argument
13 assert(tstate != NULL); in _PyErr_Occurred()
14 return tstate->curexc_type; in _PyErr_Occurred()
33 PyThreadState *tstate,
39 PyThreadState *tstate,
43 PyThreadState *tstate,
49 PyThreadState *tstate,
56 PyAPI_FUNC(void) _PyErr_Clear(PyThreadState *tstate);
58 PyAPI_FUNC(void) _PyErr_SetNone(PyThreadState *tstate, PyObject *exception);
60 PyAPI_FUNC(PyObject *) _PyErr_NoMemory(PyThreadState *tstate);
[all …]
Dpycore_pylifecycle.h23 extern PyStatus _PyUnicode_InitEncodings(PyThreadState *tstate);
36 extern int _PyLong_Init(PyThreadState *tstate);
39 extern PyObject * _PyBuiltin_Init(PyThreadState *tstate);
41 PyThreadState *tstate,
45 extern int _PySys_InitMain(PyThreadState *tstate);
49 extern PyStatus _PyImportHooks_Init(PyThreadState *tstate);
55 extern PyStatus _PyImportZip_Init(PyThreadState *tstate);
56 extern PyStatus _PyGC_Init(PyThreadState *tstate);
77 extern void _PyGC_Fini(PyThreadState *tstate);
80 extern void _PyUnicode_Fini(PyThreadState *tstate);
[all …]
Dpycore_pystate.h25 _Py_IsMainInterpreter(PyThreadState* tstate) in _Py_IsMainInterpreter() argument
29 return (tstate->interp == _PyRuntime.interpreters.main); in _Py_IsMainInterpreter()
80 _Py_EnsureFuncTstateNotNULL(const char *func, PyThreadState *tstate) in _Py_EnsureFuncTstateNotNULL() argument
82 if (tstate == NULL) { in _Py_EnsureFuncTstateNotNULL()
88 #define _Py_EnsureTstateNotNULL(tstate) \ argument
89 _Py_EnsureFuncTstateNotNULL(__func__, tstate)
101 PyThreadState *tstate = _PyThreadState_GET(); in _PyInterpreterState_GET() local
103 _Py_EnsureTstateNotNULL(tstate); in _PyInterpreterState_GET()
105 return tstate->interp; in _PyInterpreterState_GET()
112 PyThreadState *tstate);
[all …]
Dpycore_call.h12 PyThreadState *tstate,
19 PyThreadState *tstate,
26 PyThreadState *tstate,
32 _PyObject_CallNoArgTstate(PyThreadState *tstate, PyObject *func) { in _PyObject_CallNoArgTstate() argument
33 return _PyObject_VectorcallTstate(tstate, func, NULL, 0, NULL); in _PyObject_CallNoArgTstate()
/external/python/cpython3/Objects/
Dcall.c12 _PyStack_UnpackDict(PyThreadState *tstate,
22 null_error(PyThreadState *tstate) in null_error() argument
24 if (!_PyErr_Occurred(tstate)) { in null_error()
25 _PyErr_SetString(tstate, PyExc_SystemError, in null_error()
33 _Py_CheckFunctionResult(PyThreadState *tstate, PyObject *callable, in _Py_CheckFunctionResult() argument
39 if (!_PyErr_Occurred(tstate)) { in _Py_CheckFunctionResult()
41 _PyErr_Format(tstate, PyExc_SystemError, in _Py_CheckFunctionResult()
45 _PyErr_Format(tstate, PyExc_SystemError, in _Py_CheckFunctionResult()
57 if (_PyErr_Occurred(tstate)) { in _Py_CheckFunctionResult()
62 tstate, PyExc_SystemError, in _Py_CheckFunctionResult()
[all …]
Dmethodobject.c384 cfunction_check_kwargs(PyThreadState *tstate, PyObject *func, PyObject *kwnames) in cfunction_check_kwargs() argument
386 assert(!_PyErr_Occurred(tstate)); in cfunction_check_kwargs()
391 _PyErr_Format(tstate, PyExc_TypeError, in cfunction_check_kwargs()
403 cfunction_enter_call(PyThreadState *tstate, PyObject *func) in cfunction_enter_call() argument
405 if (_Py_EnterRecursiveCall(tstate, " while calling a Python object")) { in cfunction_enter_call()
416 PyThreadState *tstate = _PyThreadState_GET(); in cfunction_vectorcall_FASTCALL() local
417 if (cfunction_check_kwargs(tstate, func, kwnames)) { in cfunction_vectorcall_FASTCALL()
422 cfunction_enter_call(tstate, func); in cfunction_vectorcall_FASTCALL()
427 _Py_LeaveRecursiveCall(tstate); in cfunction_vectorcall_FASTCALL()
435 PyThreadState *tstate = _PyThreadState_GET(); in cfunction_vectorcall_FASTCALL_KEYWORDS() local
[all …]
/external/python/cpython3/Modules/
Dgcmodule.c156 _PyGC_Init(PyThreadState *tstate) in _PyGC_Init() argument
158 GCState *gcstate = &tstate->interp->gc; in _PyGC_Init()
919 handle_legacy_finalizers(PyThreadState *tstate, in handle_legacy_finalizers() argument
923 assert(!_PyErr_Occurred(tstate)); in handle_legacy_finalizers()
932 _PyErr_Clear(tstate); in handle_legacy_finalizers()
946 finalize_garbage(PyThreadState *tstate, PyGC_Head *collectable) in finalize_garbage() argument
970 assert(!_PyErr_Occurred(tstate)); in finalize_garbage()
982 delete_garbage(PyThreadState *tstate, GCState *gcstate, in delete_garbage() argument
985 assert(!_PyErr_Occurred(tstate)); in delete_garbage()
997 _PyErr_Clear(tstate); in delete_garbage()
[all …]
D_threadmodule.c807 PyThreadState *tstate; in local_clear() local
814 && (tstate = PyThreadState_Get()) in local_clear()
815 && tstate->interp) { in local_clear()
816 for(tstate = PyInterpreterState_ThreadHead(tstate->interp); in local_clear()
817 tstate; in local_clear()
818 tstate = PyThreadState_Next(tstate)) in local_clear()
819 if (tstate->dict && PyDict_GetItem(tstate->dict, self->key)) { in local_clear()
820 if (PyDict_DelItem(tstate->dict, self->key)) { in local_clear()
1024 PyThreadState *tstate; member
1032 PyThreadState *tstate; in t_bootstrap() local
[all …]
/external/python/cpython3/Parser/
Dmyreadline.c30 my_fgets(PyThreadState* tstate, char *buf, int len, FILE *fp) in my_fgets() argument
90 PyEval_RestoreThread(tstate); in my_fgets()
102 if (_PyOS_InterruptOccurred(tstate)) { in my_fgets()
116 _PyOS_WindowsConsoleReadline(PyThreadState *tstate, HANDLE hStdIn) in _PyOS_WindowsConsoleReadline() argument
151 PyEval_RestoreThread(tstate); in _PyOS_WindowsConsoleReadline()
173 PyEval_RestoreThread(tstate); in _PyOS_WindowsConsoleReadline()
182 PyEval_RestoreThread(tstate); in _PyOS_WindowsConsoleReadline()
197 PyEval_RestoreThread(tstate); in _PyOS_WindowsConsoleReadline()
210 PyEval_RestoreThread(tstate); in _PyOS_WindowsConsoleReadline()
228 PyEval_RestoreThread(tstate); in _PyOS_WindowsConsoleReadline()
[all …]
/external/python/cffi/c/
Dmisc_thread_common.h77 PyThreadState *tstate; member
150 PyThreadState *tstate = NULL; in thread_canary_free_zombies() local
155 tstate = ob->tstate; in thread_canary_free_zombies()
158 if (tstate == NULL) in thread_canary_free_zombies()
163 if (tstate == NULL) in thread_canary_free_zombies()
165 PyThreadState_Clear(tstate); /* calls thread_canary_dealloc on 'ob', in thread_canary_free_zombies()
167 PyThreadState_Delete(tstate); in thread_canary_free_zombies()
174 thread_canary_register(PyThreadState *tstate) in thread_canary_register() argument
199 canary->tstate = tstate; in thread_canary_register()
213 tstate->gilstate_counter++; in thread_canary_register()
/external/python/cpython3/Include/cpython/
Dabstract.h41 PyThreadState *tstate,
52 PyThreadState *tstate,
103 _PyObject_VectorcallTstate(PyThreadState *tstate, PyObject *callable, in _PyObject_VectorcallTstate() argument
116 return _PyObject_MakeTpCall(tstate, callable, args, nargs, kwnames); in _PyObject_VectorcallTstate()
119 return _Py_CheckFunctionResult(tstate, callable, res, NULL); in _PyObject_VectorcallTstate()
126 PyThreadState *tstate = PyThreadState_GET(); in PyObject_Vectorcall() local
127 return _PyObject_VectorcallTstate(tstate, callable, in PyObject_Vectorcall()
153 _PyObject_FastCallTstate(PyThreadState *tstate, PyObject *func, PyObject *const *args, Py_ssize_t n… in _PyObject_FastCallTstate() argument
155 return _PyObject_VectorcallTstate(tstate, func, args, (size_t)nargs, NULL); in _PyObject_FastCallTstate()
162 PyThreadState *tstate = PyThreadState_GET(); in _PyObject_FastCall() local
[all …]
/external/python/cpython2/Modules/
Dthreadmodule.c398 PyThreadState *tstate; in local_clear() local
405 && (tstate = PyThreadState_Get()) in local_clear()
406 && tstate->interp) { in local_clear()
407 for(tstate = PyInterpreterState_ThreadHead(tstate->interp); in local_clear()
408 tstate; in local_clear()
409 tstate = PyThreadState_Next(tstate)) in local_clear()
410 if (tstate->dict && in local_clear()
411 PyDict_GetItem(tstate->dict, self->key)) in local_clear()
412 PyDict_DelItem(tstate->dict, self->key); in local_clear()
605 PyThreadState *tstate; member
[all …]
/external/python/pybind11/include/pybind11/detail/
Dinternals.h111 PYBIND11_TLS_KEY_INIT(tstate);
121 PYBIND11_TLS_FREE(tstate); in ~internals()
291 PyThreadState *tstate = PyThreadState_Get(); in get_internals() local
293 internals_ptr->tstate = PyThread_tss_alloc(); in get_internals()
294 if (!internals_ptr->tstate || PyThread_tss_create(internals_ptr->tstate)) in get_internals()
296 PyThread_tss_set(internals_ptr->tstate, tstate); in get_internals()
298 internals_ptr->tstate = PyThread_create_key(); in get_internals()
299 if (internals_ptr->tstate == -1) in get_internals()
301 PyThread_set_key_value(internals_ptr->tstate, tstate); in get_internals()
303 internals_ptr->istate = tstate->interp; in get_internals()

12345