Closed Bug 1297215 Opened 8 years ago Closed 28 days ago

Share mechanism for Windows thread naming across JS and gecko

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

RESOLVED WORKSFORME

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
Severity: normal → S3

I think all threads are already named through platform, and so this is likely already accomplished.

Status: NEW → RESOLVED
Closed: 28 days ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.