Closed Bug 1364287 Opened 7 years ago Closed 7 years ago

Fix SM shell tsan failures in OSObject.cpp

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: sfink, Assigned: sfink)

References

Details

Attachments

(1 file)

Up until now, we've kept js.cpp very self-contained, and it's grown into a monstrosity. shell/OSObject.cpp tries to split off some stuff, but it ran into the monolithic nature. So I moved ShellContext into a header file so that I can store some state there instead of in global variables.
This isn't just a thread safety fix. Before this, you actually had multiple threads sharing these output files, and if more than one thread ever decided to change them, you would get a complete mess. Per-context values make much more sense than per-process.
Attachment #8867032 - Flags: review?(jcoppeard)
Comment on attachment 8867032 [details] [diff] [review]
Move g{Out,Err}FilePtr into ShellContext for thread safety

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

Nice catch.
Attachment #8867032 - Flags: review?(jcoppeard) → review+
Pushed by sfink@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/7c5aadffcf7c
Move g{Out,Err}FilePtr into ShellContext for thread safety, r=jonco
https://hg.mozilla.org/mozilla-central/rev/7c5aadffcf7c
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: