summaryrefslogtreecommitdiff
path: root/dispatch.go
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-05-28 14:56:13 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-05-28 14:59:02 -0400
commit666a0f3a3e79381aeee7e6676d50b5bef9c80947 (patch)
tree067eedf62437d8d338e6db84b9988ef3019e32d5 /dispatch.go
parent46117017c4b2b7024da27150e0eda1408a819750 (diff)
Fix wg ref counting for fetch.
Diffstat (limited to 'dispatch.go')
-rw-r--r--dispatch.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/dispatch.go b/dispatch.go
index 3746ece35..8f22f8f5d 100644
--- a/dispatch.go
+++ b/dispatch.go
@@ -80,7 +80,6 @@ func PubMsg(channel string, msg *Msg) {
}
func DispatchLoop() {
- // runtime.LockOSThread()
wg.Add(1)
first := true
@@ -96,7 +95,6 @@ func DispatchLoop() {
for {
select {
case msg := <-resChan:
- wg.Done()
out, err := proto.Marshal(msg)
if err != nil {
panic(err)
@@ -105,6 +103,7 @@ func DispatchLoop() {
stats.v8workerSend++
stats.v8workerBytesSent += len(out)
exitOnError(err)
+ wg.Done() // Corresponds to the wg.Add(1) in Pub().
case <-doneChan:
// All goroutines have completed. Now we can exit main().
return