Changeset 237 in code


Ignore:
Timestamp:
Apr 6, 2020, 5:11:26 PM (5 years ago)
Author:
contact
Message:

Remove network.lock

network.conn is now only accessed from the user goroutine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/user.go

    r231 r237  
    33import (
    44        "fmt"
    5         "sync"
    65        "time"
    76
     
    5352        stopped chan struct{}
    5453
     54        conn      *upstreamConn
    5555        history   map[string]uint64
    5656        lastError error
    57 
    58         lock sync.Mutex
    59         conn *upstreamConn
    6057}
    6158
     
    122119
    123120func (net *network) upstream() *upstreamConn {
    124         net.lock.Lock()
    125         defer net.lock.Unlock()
    126121        return net.conn
    127122}
     
    233228                        uc := e.uc
    234229
    235                         uc.network.lock.Lock()
    236230                        uc.network.conn = uc
    237                         uc.network.lock.Unlock()
    238231
    239232                        uc.updateAway()
     
    246239                        uc := e.uc
    247240
    248                         uc.network.lock.Lock()
    249241                        uc.network.conn = nil
    250                         uc.network.lock.Unlock()
    251242
    252243                        for _, ml := range uc.messageLoggers {
Note: See TracChangeset for help on using the changeset viewer.