diff options
author | Tamir Duberstein <tamird@google.com> | 2021-01-27 17:55:07 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-01-27 17:57:01 -0800 |
commit | 1d22284c13cc040e52c2130386c10d8f84f6bbd6 (patch) | |
tree | 16150d10b4fd33f863f51a2a6031a9387e26c249 /pkg/tcpip/stack/linkaddrcache_test.go | |
parent | 99988e45ed651f64e16e2f2663b06b4a1eee50d4 (diff) |
Rename anonymous struct "mu"
This clarifies that there is a lock involved.
PiperOrigin-RevId: 354213848
Diffstat (limited to 'pkg/tcpip/stack/linkaddrcache_test.go')
-rw-r--r-- | pkg/tcpip/stack/linkaddrcache_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/pkg/tcpip/stack/linkaddrcache_test.go b/pkg/tcpip/stack/linkaddrcache_test.go index 88fbbf3fe..1bf7fad09 100644 --- a/pkg/tcpip/stack/linkaddrcache_test.go +++ b/pkg/tcpip/stack/linkaddrcache_test.go @@ -124,12 +124,12 @@ func TestCacheOverflow(t *testing.T) { } } // The earliest entries should no longer be in the cache. - c.cache.Lock() - defer c.cache.Unlock() + c.mu.Lock() + defer c.mu.Unlock() for i := len(testAddrs) - 1; i >= len(testAddrs)-linkAddrCacheSize; i-- { e := testAddrs[i] - if entry, ok := c.cache.table[e.addr]; ok { - t.Errorf("unexpected entry at c.cache.table[%s]: %#v", e.addr, entry) + if entry, ok := c.mu.table[e.addr]; ok { + t.Errorf("unexpected entry at c.mu.table[%s]: %#v", e.addr, entry) } } } @@ -163,10 +163,10 @@ func TestCacheConcurrent(t *testing.T) { } e = testAddrs[0] - c.cache.Lock() - defer c.cache.Unlock() - if entry, ok := c.cache.table[e.addr]; ok { - t.Errorf("unexpected entry at c.cache.table[%s]: %#v", e.addr, entry) + c.mu.Lock() + defer c.mu.Unlock() + if entry, ok := c.mu.table[e.addr]; ok { + t.Errorf("unexpected entry at c.mu.table[%s]: %#v", e.addr, entry) } } |