MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / request_suspend_thread

Method request_suspend_thread

_pydevd_bundle/pydevd_api.py:177–201  ·  view source on GitHub ↗
(self, py_db, thread_id="*")

Source from the content-addressed store, hash-verified

175 return py_db.cmd_factory.make_list_threads_message(py_db, seq)
176
177 def request_suspend_thread(self, py_db, thread_id="*"):
178 # Yes, thread suspend is done at this point, not through an internal command.
179 threads = []
180 suspend_all = thread_id.strip() == "*"
181 if suspend_all:
182 threads = pydevd_utils.get_non_pydevd_threads()
183
184 elif thread_id.startswith("__frame__:"):
185 sys.stderr.write("Can't suspend tasklet: %s\n" % (thread_id,))
186
187 else:
188 threads = [pydevd_find_thread_by_id(thread_id)]
189
190 for t in threads:
191 if t is None:
192 continue
193 py_db.set_suspend(
194 t,
195 CMD_THREAD_SUSPEND,
196 suspend_other_threads=suspend_all,
197 is_pause=True,
198 )
199 # Break here (even if it's suspend all) as py_db.set_suspend will
200 # take care of suspending other threads.
201 break
202
203 def set_enable_thread_notifications(self, py_db, enable):
204 """

Callers 2

cmd_thread_suspendMethod · 0.80
on_pause_requestMethod · 0.80

Calls 3

pydevd_find_thread_by_idFunction · 0.90
writeMethod · 0.45
set_suspendMethod · 0.45

Tested by

no test coverage detected