We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3369f45 commit 19fe31cCopy full SHA for 19fe31c
jsonrpc2.go
@@ -32,7 +32,7 @@ type Conn struct {
32
pending map[ID]chan *WireResponse
33
pendingMu sync.Mutex // protects the pending map
34
handling map[ID]*Request
35
- handlingMu sync.Mutex // protects the handling map
+ handlingMu sync.RWMutex // protects the handling map
36
logger *zap.Logger
37
}
38
@@ -245,12 +245,12 @@ func (c *Conn) setHandling(r *Request, active bool) {
245
return
246
247
r.conn.handlingMu.Lock()
248
- defer r.conn.handlingMu.Unlock()
249
if active {
250
r.conn.handling[*r.ID] = r
251
} else {
252
delete(r.conn.handling, *r.ID)
253
+ r.conn.handlingMu.Unlock()
254
255
256
// Run blocks until the connection is terminated, and returns any error that
0 commit comments