summaryrefslogtreecommitdiff
path: root/gwic.go
diff options
context:
space:
mode:
Diffstat (limited to 'gwic.go')
-rw-r--r--gwic.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/gwic.go b/gwic.go
index c14a431..ace3fca 100644
--- a/gwic.go
+++ b/gwic.go
@@ -30,6 +30,8 @@ type work struct {
done chan struct{}
}
+// By writing to w.done we make sure that the goroutine has finished
+// sending to the out channel before returning from this method.
func (w *work) finish() {
close(w.c)
w.done <- struct{}{}