• Alan Donovan's avatar
    go/token: use fine-grained locking in FileSet · 17ba830f
    Alan Donovan authored
    Before, all accesses to the lines and infos tables of each File were
    serialized by the lock of the owning FileSet, causing parsers running
    in parallel to contend.  Now, each File has its own mutex.
    
    This fixes a data race in (*File).PositionFor, which used to call
    f.position then f.unpack without holding the mutex's lock.
    
    Fixes golang/go#18348
    
    Change-Id: Iaa5989b2eba88a7fb2e91c1a0a8bc1e7f6497f2b
    Reviewed-on: https://go-review.googlesource.com/34591Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    17ba830f
Name
Last commit
Last update
..
position.go Loading commit data...
position_test.go Loading commit data...
serialize.go Loading commit data...
serialize_test.go Loading commit data...
token.go Loading commit data...