Changeset 204 in code for trunk/user.go


Ignore:
Timestamp:
Apr 1, 2020, 2:02:31 PM (5 years ago)
Author:
contact
Message:

Simplify ring consumer goroutine

Since network.history is now only accessed from the user goroutine, a
lock becomes unnecessary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/user.go

    r203 r204  
    4242        stopped chan struct{}
    4343
    44         lock    sync.Mutex
    45         conn    *upstreamConn
    4644        history map[string]uint64
     45
     46        lock sync.Mutex
     47        conn *upstreamConn
    4748}
    4849
     
    236237                case eventDownstreamDisconnected:
    237238                        dc := e.dc
     239
     240                        for net, rc := range dc.ringConsumers {
     241                                seq := rc.Close()
     242                                net.history[dc.clientName] = seq
     243                        }
     244
    238245                        for i := range u.downstreamConns {
    239246                                if u.downstreamConns[i] == dc {
Note: See TracChangeset for help on using the changeset viewer.