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

Setup a signal context and use it. #207

Merged
merged 1 commit into from Sep 11, 2023
Merged

Setup a signal context and use it. #207

merged 1 commit into from Sep 11, 2023

Conversation

dajohi
Copy link
Member

@dajohi dajohi commented Sep 8, 2023

No description provided.

Copy link
Member

@davecgh davecgh left a comment

Choose a reason for hiding this comment

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

Nice change overall. Just a performance related comment.

cldevice.go Outdated Show resolved Hide resolved
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
//
//go:build windows || aix || android || darwin || dragonfly || freebsd || hurd || illumos || ios || linux || netbsd || openbsd || solaris
Copy link
Member

Choose a reason for hiding this comment

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

I don't think Windows should be on this list, it doesnt have SIGTERM afaik. Just os.Interrupt should suffice.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

It's correct and necessary to handle shutdown events from Windows correctly (namely CTRL_CLOSE_EVENT, CTRL_LOGOFF_EVENT and CTRL_SHUTDOWN_EVENT). Go added it a while back.

It's documented in the os/signal Windows section.

Copy link
Member

Choose a reason for hiding this comment

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

Also, just tested on windows.

Copy link
Member

Choose a reason for hiding this comment

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

I looked. It was added in Go 1.14. See the Minor changes to the library -> os/signal in the release notes.

@dajohi dajohi merged commit 46e4f80 into decred:master Sep 11, 2023
2 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

4 participants