MCPcopy Index your code
hub / github.com/fabioz/PyDev.Debugger / notify_thread_created

Method notify_thread_created

pydevd.py:1719–1742  ·  view source on GitHub ↗
(self, thread_id, thread, use_lock=True)

Source from the content-addressed store, hash-verified

1717 self.writer.add_command(self.cmd_factory.make_skipped_step_in_because_of_filters(self, frame))
1718
1719 def notify_thread_created(self, thread_id, thread, use_lock=True):
1720 if self.writer is None:
1721 # Protect about threads being created before the communication structure is in place
1722 # (note that they will appear later on anyways as pydevd does reconcile live/dead threads
1723 # when processing internal commands, albeit it may take longer and in general this should
1724 # not be usual as it's expected that the debugger is live before other threads are created).
1725 return
1726
1727 with self._lock_running_thread_ids if use_lock else NULL:
1728 if not self._enable_thread_notifications:
1729 return
1730
1731 if thread_id in self._running_thread_ids:
1732 return
1733
1734 additional_info = set_additional_thread_info(thread)
1735 if additional_info.pydev_notify_kill:
1736 # After we notify it should be killed, make sure we don't notify it's alive (on a racing condition
1737 # this could happen as we may notify before the thread is stopped internally).
1738 return
1739
1740 self._running_thread_ids[thread_id] = thread
1741
1742 self.writer.add_command(self.cmd_factory.make_thread_created_message(thread))
1743
1744 def notify_thread_not_alive(self, thread_id, use_lock=True):
1745 """if thread is not alive, cancel trace_dispatch processing"""

Callers 4

runMethod · 0.95
__call__Method · 0.80

Calls 3

add_commandMethod · 0.45

Tested by

no test coverage detected