Open Bug 1297215 Opened 4 years ago Updated 2 years ago

Share mechanism for Windows thread naming across JS and gecko

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

People

(Reporter: sfink, Unassigned)

Details

(Keywords: triage-deferred)

I added js::ThisThread::GetName in bug 1296878, but I'd really like to have it for Windows too.

The straightforward approach would be to make SetName store the thread name in TLS, and retrieve it from there on platforms that don't have an equivalent of pthread_getname_np.

Except that this wouldn't pick up Firefox's non-JS thread names, because they are set through an nspr mechanism that does exactly what I'm suggesting above:

http://dxr.mozilla.org/mozilla-central/source/xpcom/glue/nsThreadUtils.cpp#316
http://searchfox.org/mozilla-central/source/nsprpub/pr/src/pthreads/ptthread.c#1753
http://searchfox.org/mozilla-central/source/nsprpub/pr/include/private/primpl.h#1580

So I guess this is a case where Gecko's NSPR usage runs into SM's new non-NSPR code a little bit. I'm not sure what to do about it, other than filing this bug.
Keywords: triage-deferred
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.