8000 more comment · coder/ssh@773ac57 · GitHub
[go: up one dir, main page]

Skip to content

Commit 773ac57

Browse files
committed
more comment
1 parent 45772fa commit 773ac57

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

session.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,9 @@ func (sess *session) Signals(c chan<- Signal) {
263263
// and sigBuf. We also guarantee that calling Signals(ch)
264264
// followed by Signals(nil) will have depleted the sigBuf when
265265
// the second call returns and that there will be no more
266-
// signals on ch.
266+
// 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).
267269
defer sess.sigMu.Unlock()
268270
for _, sig := range sess.sigBuf {
269271
sess.sigCh <- sig

0 commit comments

Comments
 (0)
0