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
merged 1 commit into from Feb 17, 2018
Merged

Add mutex to logger #1316

merged 1 commit into from Feb 17, 2018

Conversation

@ddfreyne
Copy link
Member

@ddfreyne ddfreyne 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
Loading
@ddfreyne ddfreyne deleted the logger-mutex branch Feb 17, 2018
@Fjan
Copy link
Contributor

@Fjan Fjan 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.

Loading

@ddfreyne
Copy link
Member Author

@ddfreyne ddfreyne 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.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants