Replace wantWriteFrameCh with a method.
Also add more notes about which goroutines things should run on,
and add another check which found a bug (potential deadlock) in Ping processing.
diff --git a/gotrack.go b/gotrack.go
index b5dde40..1f55905 100644
--- a/gotrack.go
+++ b/gotrack.go
@@ -36,6 +36,15 @@
}
}
+func (g goroutineLock) checkNotOn() {
+ if !DebugGoroutines {
+ return
+ }
+ if curGoroutineID() == uint64(g) {
+ panic("running on the wrong goroutine")
+ }
+}
+
var goroutineSpace = []byte("goroutine ")
func curGoroutineID() uint64 {