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

Method _check_thread

Lib/asyncio/base_events.py:853–868  ·  view source on GitHub ↗

Check that the current thread is the thread running the event loop. Non-thread-safe methods of this class make this assumption and will likely behave incorrectly when the assumption is violated. Should only be called when (self._debug == True). The caller is respon

(self)

Source from the content-addressed store, hash-verified

851 return handle
852
853 def _check_thread(self):
854 """Check that the current thread is the thread running the event loop.
855
856 Non-thread-safe methods of this class make this assumption and will
857 likely behave incorrectly when the assumption is violated.
858
859 Should only be called when (self._debug == True). The caller is
860 responsible for checking this condition for performance reasons.
861 """
862 if self._thread_id is None:
863 return
864 thread_id = threading.get_ident()
865 if thread_id != self._thread_id:
866 raise RuntimeError(
867 "Non-thread-safe operation invoked on an event loop other "
868 "than the current one")
869
870 def call_soon_threadsafe(self, callback, *args, context=None):
871 """Like call_soon(), but thread-safe."""

Callers 2

call_atMethod · 0.95
call_soonMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected