[all-commits] [llvm/llvm-project] c90c59: [lldb] Improve thread counting in tests (#227312)

Charles Zablit via All-commits all-commits at lists.llvm.org
Wed Sep 30 08:54:20 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c90c5946e7d3943e8e4d426f0a321f7560255c16
      https://github.com/llvm/llvm-project/commit/c90c5946e7d3943e8e4d426f0a321f7560255c16
  Author: Charles Zablit <c_zablit at apple.com>
  Date:   2026-09-30 (Wed, 30 Sep 2026)

  Changed paths:
    M lldb/packages/Python/lldbsuite/test/lldbutil.py
    M lldb/test/API/functionalities/thread/exit_during_step/TestExitDuringStep.py
    M lldb/test/API/functionalities/thread/thread_exit/TestThreadExit.py

  Log Message:
  -----------
  [lldb] Improve thread counting in tests (#227312)

When a test checks how many threads a process created it uses
`process.GetNumThreads()`. This does not account for the fact that the
OS (Windows) can add threads on its own between 2 stops:

On Windows, when an `std::thread` starts, an `ntdll!TppWorkerThread` is
started as well (see [this SO
thread](https://stackoverflow.com/questions/34822072/why-does-windows-10-start-extra-threads-in-my-program)).
That thread raises `CREATE_THREAD_DEBUG_EVENT` only once it first runs,
which can be after the next stop.

This patch introduces `get_threads_in_executable` which only counts the
test's own threads rather than the OS worker threads.

rdar://188700994



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list