Inconsistent definition of js/JS_CurrentThreadId

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: sfink, Assigned: sfink)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [fixed-in-tracemonkey])

Attachments

(2 attachments)

Apparently, we still do js shell builds with JS_THREADSAFE off. I notice that the relevant portions of jslock.h are:

#ifdef JS_THREADSAFE
#define js_CurrentThreadId()        PR_GetCurrentThread()
#else
#define JS_CurrentThreadId() 0
#endif

Why the discrepancy? It means sprinkling #ifdefs in the code that uses *_CurrentThreadId().
Created attachment 509140 [details] [diff] [review]
Define both js_ and JS_CurrentThreadId with or without JS_THREADSAFE

Here's a sample patch that applies to tracemonkey after jorendorff's fix from bug 626743. It just defines both.
Attachment #509140 - Flags: review?(brendan)
Comment on attachment 509140 [details] [diff] [review]
Define both js_ and JS_CurrentThreadId with or without JS_THREADSAFE

We should not have JS_CurrentThreadId -- looks like a typo/thinko/capitalize-o.

Just js_CurrentThreadId. No way is this public API. JS_ALL_CAPS_MACROs aside, js_ for old C-compatible private and friend APIs.

/be
Attachment #509140 - Flags: review?(brendan) → review-
Created attachment 509550 [details] [diff] [review]
s/JS_CurrentThreadId/js_CurrentThreadId/
Assignee: general → sphink
Status: NEW → ASSIGNED
Attachment #509550 - Flags: review?(brendan)
Attachment #509550 - Flags: review?(brendan) → review+
http://hg.mozilla.org/mozilla-central/rev/e5866bf9c573
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.