Struct simics_api_sys::_ts

source ·
#[repr(C)]
pub struct _ts {
Show 33 fields pub prev: *mut _ts, pub next: *mut _ts, pub interp: *mut PyInterpreterState, pub frame: *mut PyFrameObject, pub recursion_depth: c_int, pub recursion_headroom: c_int, pub stackcheck_counter: c_int, pub tracing: c_int, pub cframe: *mut CFrame, pub c_profilefunc: Py_tracefunc, pub c_tracefunc: Py_tracefunc, pub c_profileobj: *mut PyObject, pub c_traceobj: *mut PyObject, pub curexc_type: *mut PyObject, pub curexc_value: *mut PyObject, pub curexc_traceback: *mut PyObject, pub exc_state: _PyErr_StackItem, pub exc_info: *mut _PyErr_StackItem, pub dict: *mut PyObject, pub gilstate_counter: c_int, pub async_exc: *mut PyObject, pub thread_id: c_ulong, pub trash_delete_nesting: c_int, pub trash_delete_later: *mut PyObject, pub on_delete: Option<unsafe extern "C" fn(arg1: *mut c_void)>, pub on_delete_data: *mut c_void, pub coroutine_origin_tracking_depth: c_int, pub async_gen_firstiter: *mut PyObject, pub async_gen_finalizer: *mut PyObject, pub context: *mut PyObject, pub context_ver: u64, pub id: u64, pub root_cframe: CFrame,
}
Expand description

Forward declarations for PyThreadState

Fields§

§prev: *mut _ts

See Python/ceval.c for comments explaining most fields

§next: *mut _ts§interp: *mut PyInterpreterState§frame: *mut PyFrameObject

Borrowed reference to the current frame (it can be NULL)

§recursion_depth: c_int§recursion_headroom: c_int

Allow 50 more calls to handle any errors.

§stackcheck_counter: c_int§tracing: c_int

‘tracing’ keeps track of the execution depth when tracing/profiling. This is to prevent the actual trace/profile code from being recorded in the trace/profile.

§cframe: *mut CFrame

Pointer to current CFrame in the C stack frame of the currently, or most recently, executing _PyEval_EvalFrameDefault.

§c_profilefunc: Py_tracefunc§c_tracefunc: Py_tracefunc§c_profileobj: *mut PyObject§c_traceobj: *mut PyObject§curexc_type: *mut PyObject

The exception currently being raised

§curexc_value: *mut PyObject§curexc_traceback: *mut PyObject§exc_state: _PyErr_StackItem

The exception currently being handled, if no coroutines/generators are present. Always last element on the stack referred to be exc_info.

§exc_info: *mut _PyErr_StackItem

Pointer to the top of the stack of the exceptions currently being handled

§dict: *mut PyObject

Stores per-thread state

§gilstate_counter: c_int§async_exc: *mut PyObject

Asynchronous exception to raise

§thread_id: c_ulong

Thread id where this tstate was created

§trash_delete_nesting: c_int§trash_delete_later: *mut PyObject§on_delete: Option<unsafe extern "C" fn(arg1: *mut c_void)>

Called when a thread state is deleted normally, but not when it is destroyed after fork(). Pain: to prevent rare but fatal shutdown errors (issue 18808), Thread.join() must wait for the join’ed thread’s tstate to be unlinked from the tstate chain. That happens at the end of a thread’s life, in pystate.c. The obvious way doesn’t quite work: create a lock which the tstate unlinking code releases, and have Thread.join() wait to acquire that lock. The problem is that we are at the end of the thread’s life: if the thread holds the last reference to the lock, decref’ing the lock will delete the lock, and that may trigger arbitrary Python code if there’s a weakref, with a callback, to the lock. But by this time _PyRuntime.gilstate.tstate_current is already NULL, so only the simplest of C code can be allowed to run (in particular it must not be possible to release the GIL). So instead of holding the lock directly, the tstate holds a weakref to the lock: that’s the value of on_delete_data below. Decref’ing a weakref is harmless. on_delete points to _threadmodule.c’s static release_sentinel() function. After the tstate is unlinked, release_sentinel is called with the weakref-to-lock (on_delete_data) argument, and release_sentinel releases the indirectly held lock.

§on_delete_data: *mut c_void§coroutine_origin_tracking_depth: c_int§async_gen_firstiter: *mut PyObject§async_gen_finalizer: *mut PyObject§context: *mut PyObject§context_ver: u64§id: u64

Unique thread state id.

§root_cframe: CFrame

Trait Implementations§

source§

impl Clone for _ts

source§

fn clone(&self) -> _ts

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for _ts

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for _ts

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Hash for _ts

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for _ts

source§

fn cmp(&self, other: &_ts) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for _ts

source§

fn eq(&self, other: &_ts) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for _ts

source§

fn partial_cmp(&self, other: &_ts) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for _ts

source§

impl Eq for _ts

source§

impl StructuralPartialEq for _ts

Auto Trait Implementations§

§

impl Freeze for _ts

§

impl RefUnwindSafe for _ts

§

impl !Send for _ts

§

impl !Sync for _ts

§

impl Unpin for _ts

§

impl UnwindSafe for _ts

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.