Skip to content

Take the stdout lock when printing profile data - #10589

Merged
bors-servo merged 1 commit into
servo:masterfrom
fitzgen:lock-stdout-when-printing-profile
Apr 14, 2016
Merged

bors-servo merged 1 commit into
servo:masterfrom
fitzgen:lock-stdout-when-printing-profile

Conversation

@fitzgen

@fitzgen fitzgen commented Apr 13, 2016

Copy link
Copy Markdown
Contributor

Acquiring the stdout lock while printing the profile data prevents other
messages printed to stdout from being interleaved with prints from elsewhere.


This change is Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 13, 2016
@larsbergstrom

Copy link
Copy Markdown
Contributor

Reviewed 1 of 1 files at r1.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


components/profile/time.rs, line 258 [r1] (raw file):
We typically just call .unwrap() instead, so that it will ignore success messages but panic on a failure. Is there a reason you didn't want to do this? Are there some cases where it was OK/normal to be seeing failure from writeln!?


Comments from Reviewable

@larsbergstrom larsbergstrom added S-awaiting-answer Someone asked a question that requires an answer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Apr 14, 2016
@Ms2ger

Ms2ger commented Apr 14, 2016

Copy link
Copy Markdown
Contributor

Alternatively, use let _ = instead of ignore()

@larsbergstrom

Copy link
Copy Markdown
Contributor

Yeah, please either .unwrap() or use let _ =, the latter of which is pretty typical in Servo code.

@fitzgen

fitzgen commented Apr 14, 2016

Copy link
Copy Markdown
Contributor Author

Ok, I will .unwrap()! New patch up in a minute!

Acquiring the stdout lock while printing the profile data prevents other
messages printed to stdout from being interleaved with prints from elsewhere.
@fitzgen
fitzgen force-pushed the lock-stdout-when-printing-profile branch from ec7f0dc to 1997d03 Compare April 14, 2016 19:31
@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 14, 2016
@fitzgen

fitzgen commented Apr 14, 2016

Copy link
Copy Markdown
Contributor Author

New commit pushed: no more ignore, using unwrap instead.

@larsbergstrom

Copy link
Copy Markdown
Contributor

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 1997d03 has been approved by larsbergstrom

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. S-awaiting-answer Someone asked a question that requires an answer. labels Apr 14, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 1997d03 with merge d9ffefe...

bors-servo pushed a commit that referenced this pull request Apr 14, 2016
…arsbergstrom

Take the stdout lock when printing profile data

Acquiring the stdout lock while printing the profile data prevents other
messages printed to stdout from being interleaved with prints from elsewhere.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10589)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt

@bors-servo
bors-servo merged commit 1997d03 into servo:master Apr 14, 2016
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants