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

POA-2904 Use sync.Once #84

Merged
merged 1 commit into from
Feb 19, 2025
Merged

POA-2904 Use sync.Once #84

merged 1 commit into from
Feb 19, 2025

Conversation

liujed
Copy link
Contributor

@liujed liujed commented Feb 19, 2025

Tested locally:

[INFO] Running learn mode on interfaces lo, wlan0
[INFO] Send SIGINT (Ctrl-C) to stop...
^C[INFO] Received interrupt, stopping trace collection...
[INFO] Trace collection stopped
[INFO] Did not capture any TCP packets matching the filter. This may mean your filter is incorrect, such as the wrong TCP port.
[ERROR] No HTTP calls captured! 🛑

[ERROR] Error during initiaization: API trace is empty
[INFO] This process will not exit, to avoid boot loops. Please correct the command line flags or environment and retry.

// closed.
running *atomic.Bool
// Ensures that exitChannel is closed at most once.
closeExitChannelOnce *sync.Once
Copy link
Contributor

Choose a reason for hiding this comment

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

There's no need for a * here, but it's fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The * avoids copying the Once instance when a Redactor is copied.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But I suppose Redactor instances shouldn't be copied regardless!

@liujed liujed merged commit bd886af into main Feb 19, 2025
4 checks passed
@liujed liujed deleted the jed/poa-2904 branch February 19, 2025 23:28
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.

2 participants