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

enhance: gproc.signal enhance #3325 #3326

Merged
merged 7 commits into from
Mar 4, 2024
Merged

enhance: gproc.signal enhance #3325 #3326

merged 7 commits into from
Mar 4, 2024

Conversation

Agzer0
Copy link
Contributor

@Agzer0 Agzer0 commented Feb 25, 2024

No description provided.

@gqcn
Copy link
Member

gqcn commented Feb 27, 2024

@Agzer0 Would you please give a brief description about your changes?

@Agzer0
Copy link
Contributor Author

Agzer0 commented Feb 28, 2024

Implemented the following changes for #3325:

  1. Used sync.Once to restrict Listen() so that it is executed only once, avoiding multiple executions of Listen() that could lead to repetitive triggering of handlers.
  2. Used waitChan to ensure that Listen() remains blocking.
  3. In AddSigHandlerShutdown() and AddSigHandler(), invoked signal.Notify() everytime so that even if signals are added after Listen(), they can still be registered and listened to.

@Agzer0 Agzer0 requested a review from gqcn February 29, 2024 13:01
@gqcn gqcn merged commit 849b104 into gogf:master Mar 4, 2024
20 checks passed
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