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

Fix deadlock when reading and writer is closed. #6

Merged
merged 4 commits into from
Jun 5, 2021

Conversation

wnke
Copy link
Contributor

@wnke wnke commented May 10, 2021

No description provided.

wnke added 3 commits May 10, 2021 16:01
Add test for close deadlock
Fix deadlock on close
Copy link
Owner

@acomagu acomagu left a comment

Choose a reason for hiding this comment

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

Nice catch! Thank you!

go.mod Outdated
module github.com/acomagu/bufpipe
module github.com/wnke/bufpipe
Copy link
Owner

Choose a reason for hiding this comment

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

Could you revert this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Of course.

bufpipe.go Outdated
@@ -124,5 +124,6 @@ func (w *PipeWriter) CloseWithError(err error) error {
err = io.EOF
}
w.rerr = err
w.cond.Signal()
Copy link
Owner

Choose a reason for hiding this comment

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

I think this should be Broadcast(), don't you?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, updated!

@wnke wnke requested a review from acomagu June 4, 2021 21:41
Copy link
Owner

@acomagu acomagu left a comment

Choose a reason for hiding this comment

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

Thank you!!!

@acomagu acomagu merged commit cd7a5f7 into acomagu:master Jun 5, 2021
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.

3 participants