diff --git a/fs/session/root.go b/fs/session/root.go index f530e4b..f4ed3ae 100644 --- a/fs/session/root.go +++ b/fs/session/root.go @@ -23,7 +23,7 @@ const eventRingCap = 100 type eventRing struct { mu sync.Mutex - cond sync.Cond + cond *sync.Cond buf []string // circular: buf[start%cap]..buf[(start+count-1)%cap] cap int start int @@ -31,9 +31,9 @@ type eventRing struct { total int64 // monotonic counter; doubles as stable offset } -var evRing = func() eventRing { - e := eventRing{cap: eventRingCap, buf: make([]string, eventRingCap)} - e.cond.L = &e.mu +var evRing = func() *eventRing { + e := &eventRing{cap: eventRingCap, buf: make([]string, eventRingCap)} + e.cond = sync.NewCond(&e.mu) return e }()