MCPcopy Index your code
hub / github.com/RustPython/RustPython / is_main_thread

Method is_main_thread

crates/vm/src/vm/mod.rs:689–698  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

687 /// Mirrors `_Py_ThreadCanHandleSignals`.
688 #[allow(dead_code)]
689 pub(crate) fn is_main_thread(&self) -> bool {
690 #[cfg(feature = "threading")]
691 {
692 crate::stdlib::_thread::get_ident() == self.state.main_thread_ident.load()
693 }
694 #[cfg(not(feature = "threading"))]
695 {
696 true
697 }
698 }
699
700 /// Create a new `VirtualMachine` structure.
701 pub(crate) fn new(ctx: PyRc<Context>, state: PyRc<PyGlobalState>) -> Self {

Callers 4

signalFunction · 0.80
set_wakeup_fdFunction · 0.80
eval_breaker_trippedMethod · 0.80
check_signalsMethod · 0.80

Calls 2

get_identFunction · 0.50
loadMethod · 0.45

Tested by

no test coverage detected