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

Add mutex to logger #1316

merged 1 commit into from Feb 17, 2018


None yet
2 participants
Copy link

commented Feb 17, 2018

Fixes #1312.

God knows how to test this.

@ddfreyne ddfreyne merged commit d09c9b3 into master Feb 17, 2018

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress

@ddfreyne ddfreyne deleted the logger-mutex branch Feb 17, 2018


This comment has been minimized.

Copy link

commented Feb 17, 2018

Thanks for the fix. However, adding a mutex is a lot heavier than simply using a print statement, which is atomic by itself.


This comment has been minimized.

Copy link
Member Author

commented Feb 17, 2018

@Fjan I opted for a mutex for two reasons:

  1. I’d prefer not to rely on #print being atomic — it is not documented to be atomic, and not all Ruby implementations might implement #print atomically.

  2. Mutexes are so cheap that the slowdown of using mutex is unlikely to be noticeable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.