The default bug view has changed. See this FAQ.

Move JS_CallOnce to jsapi.cpp

RESOLVED FIXED in mozilla10

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: sfink, Assigned: sfink)

Tracking

unspecified
mozilla10
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
Currently it is in jslock.cpp alongside all the other low-level synchronization functionality. But it's the only JSAPI function defined there, and nothing else requires jsapi.h, so it seems like it would be more at home in jsapi.cpp.
(Assignee)

Comment 1

6 years ago
Created attachment 566437 [details] [diff] [review]
Once Upon a JSAPI
Attachment #566437 - Flags: review?(jwalden+bmo)
(Assignee)

Comment 2

6 years ago
Created attachment 568197 [details] [diff] [review]
Once Upon a JSAPI

As long as I'm moving it, perhaps I should make it work, too -- I had the success/failure sdrawkcab.
Attachment #566437 - Attachment is obsolete: true
Attachment #566437 - Flags: review?(jwalden+bmo)
Attachment #568197 - Flags: review?(jwalden+bmo)
Comment on attachment 568197 [details] [diff] [review]
Once Upon a JSAPI

Review of attachment 568197 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jsapi.cpp
@@ +6280,5 @@
>  }
>  
>  #endif
> +
> +#ifdef JS_THREADSAFE

I think I would prefer if you had two threadsafe #ifdef blocks here: one around CallOnce, and another within the body of JS_CallOnce, splitting for the two different implementations.  This would avoid having to repeat the JS_CallOnce signature stuff, which right now is effectively just copy-paste.
Attachment #568197 - Flags: review?(jwalden+bmo) → review+
(Assignee)

Comment 4

6 years ago
I think I agree. Thanks.
(Assignee)

Comment 5

6 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/f12386561999
Target Milestone: --- → mozilla10
https://hg.mozilla.org/mozilla-central/rev/f12386561999
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.