Closed Bug 693907 Opened 10 years ago Closed 10 years ago

Move JS_CallOnce to jsapi.cpp

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla10

People

(Reporter: sfink, Assigned: sfink)

Details

Attachments

(1 file, 1 obsolete file)

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.
Attached patch Once Upon a JSAPI (obsolete) — Splinter Review
Attachment #566437 - Flags: review?(jwalden+bmo)
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+
I think I agree. Thanks.
https://hg.mozilla.org/mozilla-central/rev/f12386561999
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.