8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45772fa commit 773ac57Copy full SHA for 773ac57
session.go
@@ -263,7 +263,9 @@ func (sess *session) Signals(c chan<- Signal) {
263
// and sigBuf. We also guarantee that calling Signals(ch)
264
// followed by Signals(nil) will have depleted the sigBuf when
265
// the second call returns and that there will be no more
266
- // signals on ch.
+ // signals on ch. This is done in a goroutine so we can return
267
+ // early and allow the caller to set up processing for the
268
+ // channel even after calling Signals(ch).
269
defer sess.sigMu.Unlock()
270
for _, sig := range sess.sigBuf {
271
sess.sigCh <- sig
0 commit comments