(self, thread, frame, event, arg, trace_suspend_type, from_this_thread, frames_tracker)
| 2204 | pydev_log.debug("Leaving PyDB.do_wait_suspend: %s (%s) %s", thread, thread_id, id(thread)) |
| 2205 | |
| 2206 | def _do_wait_suspend(self, thread, frame, event, arg, trace_suspend_type, from_this_thread, frames_tracker): |
| 2207 | info = thread.additional_info |
| 2208 | try: |
| 2209 | info.is_in_wait_loop = True |
| 2210 | info.update_stepping_info() |
| 2211 | info.step_in_initial_location = None |
| 2212 | keep_suspended = False |
| 2213 | |
| 2214 | with self._main_lock: # Use lock to check if suspended state changed |
| 2215 | activate_gui = info.pydev_state == STATE_SUSPEND and not self.pydb_disposed |
| 2216 | |
| 2217 | in_main_thread = is_current_thread_main_thread() |
| 2218 | if activate_gui and in_main_thread: |
| 2219 | # before every stop check if matplotlib modules were imported inside script code |
| 2220 | # or some GUI event loop needs to be activated |
| 2221 | self._activate_gui_if_needed() |
| 2222 | |
| 2223 | # self.process_internal_commands(): processes for all the threads |
| 2224 | # and updates running threads. This was called once in `do_wait_suspend` |
| 2225 | # At this point it's just processing for this thread. |
| 2226 | # Note that clients may not post an actual event (for instance, it |
| 2227 | # could just set the internal state and signal the event instead |
| 2228 | # of posting a command to the queue). In any case, if an item is |
| 2229 | # put in the queue, the event must be set too. |
| 2230 | curr_thread_id = get_current_thread_id(threadingCurrentThread()) |
| 2231 | queue, notify_event = self.get_internal_queue_and_event(curr_thread_id) |
| 2232 | |
| 2233 | wait_timeout = TIMEOUT_SLOW |
| 2234 | while True: |
| 2235 | with self._main_lock: # Use lock to check if suspended state changed |
| 2236 | if info.pydev_state != STATE_SUSPEND or (self.pydb_disposed and not self.terminate_requested): |
| 2237 | # Note: we can't exit here if terminate was requested while a breakpoint was hit. |
| 2238 | break |
| 2239 | |
| 2240 | if in_main_thread and self.gui_in_use: |
| 2241 | wait_timeout = TIMEOUT_FAST |
| 2242 | # call input hooks if only GUI is in use |
| 2243 | self._call_input_hook() |
| 2244 | |
| 2245 | # No longer process commands for '*' at this point, just the |
| 2246 | # ones related to this thread. |
| 2247 | try: |
| 2248 | internal_cmd = queue.get(False) |
| 2249 | except _queue.Empty: |
| 2250 | pass |
| 2251 | else: |
| 2252 | if internal_cmd.can_be_executed_by(curr_thread_id): |
| 2253 | pydev_log.verbose("processing internal command: %s", internal_cmd) |
| 2254 | try: |
| 2255 | internal_cmd.do_it(self) |
| 2256 | except: |
| 2257 | pydev_log.exception("Error processing internal command.") |
| 2258 | else: |
| 2259 | # This shouldn't really happen... |
| 2260 | pydev_log.verbose("NOT processing internal command: %s ", internal_cmd) |
| 2261 | queue.put(internal_cmd) |
| 2262 | wait_timeout = TIMEOUT_FAST |
| 2263 |
no test coverage detected