Lines Matching refs:ceval
125 #define GIL_REQUEST _Py_atomic_load_relaxed(&ceval->gil_drop_request)
130 #define COMPUTE_EVAL_BREAKER(ceval) \ argument
132 &(ceval)->eval_breaker, \
134 _Py_atomic_load_relaxed(&(ceval)->signals_pending) | \
135 _Py_atomic_load_relaxed(&(ceval)->pending.calls_to_do) | \
136 (ceval)->pending.async_exc)
138 #define SET_GIL_DROP_REQUEST(ceval) \ argument
140 _Py_atomic_store_relaxed(&(ceval)->gil_drop_request, 1); \
141 _Py_atomic_store_relaxed(&(ceval)->eval_breaker, 1); \
144 #define RESET_GIL_DROP_REQUEST(ceval) \ argument
146 _Py_atomic_store_relaxed(&(ceval)->gil_drop_request, 0); \
147 COMPUTE_EVAL_BREAKER(ceval); \
151 #define SIGNAL_PENDING_CALLS(ceval) \ argument
153 _Py_atomic_store_relaxed(&(ceval)->pending.calls_to_do, 1); \
154 _Py_atomic_store_relaxed(&(ceval)->eval_breaker, 1); \
157 #define UNSIGNAL_PENDING_CALLS(ceval) \ argument
159 _Py_atomic_store_relaxed(&(ceval)->pending.calls_to_do, 0); \
160 COMPUTE_EVAL_BREAKER(ceval); \
163 #define SIGNAL_PENDING_SIGNALS(ceval) \ argument
165 _Py_atomic_store_relaxed(&(ceval)->signals_pending, 1); \
166 _Py_atomic_store_relaxed(&(ceval)->eval_breaker, 1); \
169 #define UNSIGNAL_PENDING_SIGNALS(ceval) \ argument
171 _Py_atomic_store_relaxed(&(ceval)->signals_pending, 0); \
172 COMPUTE_EVAL_BREAKER(ceval); \
175 #define SIGNAL_ASYNC_EXC(ceval) \ argument
177 (ceval)->pending.async_exc = 1; \
178 _Py_atomic_store_relaxed(&(ceval)->eval_breaker, 1); \
181 #define UNSIGNAL_ASYNC_EXC(ceval) \ argument
183 (ceval)->pending.async_exc = 0; \
184 COMPUTE_EVAL_BREAKER(ceval); \
197 return gil_created(&_PyRuntime.ceval.gil); in PyEval_ThreadsInitialized()
204 struct _ceval_runtime_state *ceval = &runtime->ceval; in PyEval_InitThreads() local
205 struct _gil_runtime_state *gil = &ceval->gil; in PyEval_InitThreads()
213 take_gil(ceval, tstate); in PyEval_InitThreads()
215 struct _pending_calls *pending = &ceval->pending; in PyEval_InitThreads()
223 _PyEval_FiniThreads(struct _ceval_runtime_state *ceval) in _PyEval_FiniThreads() argument
225 struct _gil_runtime_state *gil = &ceval->gil; in _PyEval_FiniThreads()
233 struct _pending_calls *pending = &ceval->pending; in _PyEval_FiniThreads()
245 drop_gil(&runtime->ceval, tstate); in exit_thread_if_finalizing()
283 struct _ceval_runtime_state *ceval = &runtime->ceval; in PyEval_AcquireLock() local
288 take_gil(ceval, tstate); in PyEval_AcquireLock()
301 drop_gil(&runtime->ceval, tstate); in PyEval_ReleaseLock()
312 struct _ceval_runtime_state *ceval = &runtime->ceval; in PyEval_AcquireThread() local
315 assert(gil_created(&ceval->gil)); in PyEval_AcquireThread()
316 take_gil(ceval, tstate); in PyEval_AcquireThread()
335 drop_gil(&runtime->ceval, tstate); in PyEval_ReleaseThread()
346 struct _ceval_runtime_state *ceval = &runtime->ceval; in _PyEval_ReInitThreads() local
347 if (!gil_created(&ceval->gil)) { in _PyEval_ReInitThreads()
350 recreate_gil(&ceval->gil); in _PyEval_ReInitThreads()
352 take_gil(ceval, current_tstate); in _PyEval_ReInitThreads()
354 struct _pending_calls *pending = &ceval->pending; in _PyEval_ReInitThreads()
368 _PyEval_SignalAsyncExc(struct _ceval_runtime_state *ceval) in _PyEval_SignalAsyncExc() argument
370 SIGNAL_ASYNC_EXC(ceval); in _PyEval_SignalAsyncExc()
377 struct _ceval_runtime_state *ceval = &runtime->ceval; in PyEval_SaveThread() local
382 assert(gil_created(&ceval->gil)); in PyEval_SaveThread()
383 drop_gil(ceval, tstate); in PyEval_SaveThread()
391 struct _ceval_runtime_state *ceval = &runtime->ceval; in PyEval_RestoreThread() local
396 assert(gil_created(&ceval->gil)); in PyEval_RestoreThread()
399 take_gil(ceval, tstate); in PyEval_RestoreThread()
430 _PyEval_SignalReceived(struct _ceval_runtime_state *ceval) in _PyEval_SignalReceived() argument
435 SIGNAL_PENDING_SIGNALS(ceval); in _PyEval_SignalReceived()
476 struct _ceval_runtime_state *ceval, in _PyEval_AddPendingCall() argument
479 struct _pending_calls *pending = &ceval->pending; in _PyEval_AddPendingCall()
498 SIGNAL_PENDING_CALLS(ceval); in _PyEval_AddPendingCall()
507 return _PyEval_AddPendingCall(tstate, &runtime->ceval, func, arg); in Py_AddPendingCall()
528 struct _ceval_runtime_state *ceval = &runtime->ceval; in handle_signals() local
529 UNSIGNAL_PENDING_SIGNALS(ceval); in handle_signals()
531 SIGNAL_PENDING_SIGNALS(ceval); /* We're not done yet */ in handle_signals()
552 struct _ceval_runtime_state *ceval = &runtime->ceval; in make_pending_calls() local
555 UNSIGNAL_PENDING_CALLS(ceval); in make_pending_calls()
559 struct _pending_calls *pending = &ceval->pending; in make_pending_calls()
584 SIGNAL_PENDING_CALLS(ceval); in make_pending_calls()
594 struct _pending_calls *pending = &runtime->ceval.pending; in _Py_FinishPendingCalls()
655 return _PyRuntime.ceval.recursion_limit; in Py_GetRecursionLimit()
661 struct _ceval_runtime_state *ceval = &_PyRuntime.ceval; in Py_SetRecursionLimit() local
662 ceval->recursion_limit = new_limit; in Py_SetRecursionLimit()
663 _Py_CheckRecursionLimit = ceval->recursion_limit; in Py_SetRecursionLimit()
676 int recursion_limit = runtime->ceval.recursion_limit; in _Py_CheckRecursiveCall()
712 #define _Py_TracingPossible(ceval) ((ceval)->tracing_possible) argument
758 struct _ceval_runtime_state * const ceval = &runtime->ceval; in _PyEval_EvalFrameDefault() local
759 _Py_atomic_int * const eval_breaker = &ceval->eval_breaker; in _PyEval_EvalFrameDefault()
847 if (!lltrace && !_Py_TracingPossible(ceval) && !PyDTrace_LINE_ENABLED()) { \ in _PyEval_EvalFrameDefault()
857 if (!_Py_TracingPossible(ceval) && !PyDTrace_LINE_ENABLED()) { \ in _PyEval_EvalFrameDefault()
1226 if (_Py_atomic_load_relaxed(&ceval->signals_pending)) { in _PyEval_EvalFrameDefault()
1231 if (_Py_atomic_load_relaxed(&ceval->pending.calls_to_do)) { in _PyEval_EvalFrameDefault()
1237 if (_Py_atomic_load_relaxed(&ceval->gil_drop_request)) { in _PyEval_EvalFrameDefault()
1242 drop_gil(ceval, tstate); in _PyEval_EvalFrameDefault()
1246 take_gil(ceval, tstate); in _PyEval_EvalFrameDefault()
1259 UNSIGNAL_ASYNC_EXC(ceval); in _PyEval_EvalFrameDefault()
1274 if (_Py_TracingPossible(ceval) && in _PyEval_EvalFrameDefault()
4716 runtime->ceval.tracing_possible += (func != NULL) - (tstate->c_tracefunc != NULL); in PyEval_SetTrace()