[PATCH] D147361: [Support] Use newer thread naming API if available on Windows.

Scott Todd via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 3 12:55:17 PDT 2023


scotttodd added inline comments.


================
Comment at: llvm/lib/Support/Windows/Threading.inc:120-128
 void llvm::get_thread_name(SmallVectorImpl<char> &Name) {
   // "Name" is not an inherent property of a thread on Windows.  In fact, when
   // you "set" the name, you are only firing a one-time message to a debugger
   // which it interprets as a program setting its threads' name.  We may be
   // able to get fancy by creating a TLS entry when someone calls
   // set_thread_name so that subsequent calls to get_thread_name return this
   // value.
----------------
Ah, looks like there is a matching new API for getting the thread name: https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getthreaddescription


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147361/new/

https://reviews.llvm.org/D147361



More information about the llvm-commits mailing list