summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvan Jegen <s.jegen@gmail.com>2015-10-23 19:43:02 +0200
committerSilvan Jegen <s.jegen@gmail.com>2015-10-27 21:40:57 +0100
commit4e2225a64d61a84aedab5d3054199a5229b23c04 (patch)
tree8426b7c216fbd863817cdf858a5aff6d6c942cdc
parent52f3c395ace14cbac92c3a8a96b5d5a241b844c4 (diff)
Comment finish method
-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{}{}