Skip to content

Commit 68f9dcb

Browse files
Bryan C. Millsgopherbot
authored andcommitted
windows/debug/svc: buffer channel passed to signal.Notify
The os/signal package drops signal notifications if the channel is not ready to receive immediately. To avoid dropping signals (for example, while processing the other branch of a 'select'), the channel must be buffered. This fixes a mistake flagged by 'go vet ./...'. Change-Id: I2a20dbe2aa27ae8ec009fff5e7be47e4409fdddd Reviewed-on: https://go-review.googlesource.com/c/sys/+/465595 Auto-Submit: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Quim Muntal <quimmuntal@gmail.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
1 parent 0e1262c commit 68f9dcb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

windows/svc/debug/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func Run(name string, handler svc.Handler) error {
2323
cmds := make(chan svc.ChangeRequest)
2424
changes := make(chan svc.Status)
2525

26-
sig := make(chan os.Signal)
26+
sig := make(chan os.Signal, 1)
2727
signal.Notify(sig)
2828

2929
go func() {

0 commit comments

Comments
 (0)