Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronize reads/writes to outputData and errorData #25

Merged

Conversation

harlanhaskins
Copy link
Contributor

Since the FileHandle readabilityHandlers execute asyncronously, possibly
on multiple different queues, we need to guard the reads/writes of the
outputData/errorData on a serial dispatch queue, and block until all
writes have finished.

@harlanhaskins
Copy link
Contributor Author

harlanhaskins commented Dec 9, 2017

This fixes the bug I observed with Lite's parallel test runner. TSan runs clean with this fix.

Since the FileHandle readabilityHandlers execute asyncronously, possibly
on multiple different queues, we need to guard the reads/writes of the
outputData/errorData on a serial dispatch queue, and block until all
writes have finished.
@harlanhaskins harlanhaskins changed the title Guard appending to outputData and errorData Synchronize reads/writes to outputData and errorData Dec 9, 2017
Copy link
Owner

@JohnSundell JohnSundell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome stuff! 👍 Thanks a lot @harlanhaskins 🎉

@JohnSundell JohnSundell merged commit f1c253a into JohnSundell:master Jan 4, 2018
@harlanhaskins harlanhaskins deleted the on-your-mark-get-set-go branch January 4, 2018 22:59
@harlanhaskins
Copy link
Contributor Author

Thanks for the merge! Mind doing another tag on master so I can update https://github.com/silt-lang/Lite's Package.swift?

@JohnSundell
Copy link
Owner

Sure, will do 👍

@JohnSundell
Copy link
Owner

And it's me who should thank you for contributing ;)

@JohnSundell
Copy link
Owner

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.

None yet

2 participants