Use SetThreadDescription on Windows 10

NEW
Unassigned

Status

()

2 years ago
a year ago

People

(Reporter: dmajor, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
Windows 10 starting in version 1607 has a new API for setting thread names: https://msdn.microsoft.com/en-us/library/windows/desktop/mt774976(v=vs.85).aspx

This is better than the longstanding magic-number-exception trick because the description "sticks": you won't miss out on the thread name if you don't have a debugger attached at the time of the call.

Any code that currently uses the magic number should be augmented with an additional SetThreadDescription on machines that support it: https://dxr.mozilla.org/mozilla-central/search?q=0x406d1388
Thanks for finding this out!
The major usage comes from _PR_MD_SET_CURRENT_THREAD_NAME in NSPR, fixing it will fix 99%.  

I think this should be a meta bug and each module should have it's own bug/patch filed under respective components.
Component: Build Config → General
Depends on: 1362976
(Reporter)

Comment 3

2 years ago
> I think this should be a meta bug and each module should have it's own
> bug/patch filed under respective components.

Agreed, and I was planning to do so myself, but since this is not perf-related it is low priority for me right now. Thank you for taking on the NSPR piece!
You need to log in before you can comment on or make changes to this bug.