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

Cleanup ringbuffer stop logic #591

Merged
merged 1 commit into from
Mar 3, 2021
Merged

Cleanup ringbuffer stop logic #591

merged 1 commit into from
Mar 3, 2021

Conversation

grantseltzer
Copy link
Contributor

fix: rb.stopped should be set in the Stop method

This cleans up the design of a solution to an issue where Stop()
could be called after the sole consumer of the rb.stop channel
has closed but rb.stopped has not yet been set. This removes
the need to have a non-blocking channel write with select as
it turns out we really don't need this channel at all.

Signed-off-by: grantseltzer grantseltzer@gmail.com

This cleans up the design of a solution to an issue where Stop()
 could be called after the sole consumer of the rb.stop channel
 has closed but rb.stopped has not yet been set. This removes
the need to have a non-blocking channel write with `select` as
it turns out we really don't need this channel at all.

Signed-off-by: grantseltzer <grantseltzer@gmail.com>
Copy link
Collaborator

@yanivagman yanivagman left a comment

Choose a reason for hiding this comment

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

Much cleaner!

@grantseltzer grantseltzer merged commit 9a25d02 into aquasecurity:main Mar 3, 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.

None yet

2 participants