diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2021-03-22 22:24:47 +0000 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2021-03-22 22:24:47 +0000 |
commit | 47d79d414b280760d18b183c250e1b00e5ef1726 (patch) | |
tree | 6a6d1319c58c37a46c83fba0309755d4d9b7784d /pkg/tcpip/stack | |
parent | 0db21bb9e3827337ff791fbd714a25030641c0e1 (diff) | |
parent | f10d89ade6e9715332cc15d163acd00b9816c0e3 (diff) |
Merge remote-tracking branch 'kevingc/align32' into go-align32go-align32
Diffstat (limited to 'pkg/tcpip/stack')
-rw-r--r-- | pkg/tcpip/stack/stack.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/tcpip/stack/stack.go b/pkg/tcpip/stack/stack.go index 931a97ddc..fd806f46e 100644 --- a/pkg/tcpip/stack/stack.go +++ b/pkg/tcpip/stack/stack.go @@ -29,6 +29,7 @@ import ( "time" "golang.org/x/time/rate" + "gvisor.dev/gvisor/pkg/atomicbitops" "gvisor.dev/gvisor/pkg/rand" "gvisor.dev/gvisor/pkg/sync" "gvisor.dev/gvisor/pkg/tcpip" @@ -366,10 +367,10 @@ type ResumableEndpoint interface { } // uniqueIDGenerator is a default unique ID generator. -type uniqueIDGenerator uint64 +type uniqueIDGenerator atomicbitops.AlignedAtomicUint64 func (u *uniqueIDGenerator) UniqueID() uint64 { - return atomic.AddUint64((*uint64)(u), 1) + return ((*atomicbitops.AlignedAtomicUint64)(u)).Add(1) } // Stack is a networking stack, with all supported protocols, NICs, and route |