From c0367dd238c6204ed48a9ccbbf39583cc593918e Mon Sep 17 00:00:00 2001 From: Dirk Chang Date: Fri, 21 Jan 2022 15:14:30 +0800 Subject: [PATCH] fix unaligned 64-bit atomic operation issue on arm32 device --- connection.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/connection.go b/connection.go index cdc913a..c9825fb 100644 --- a/connection.go +++ b/connection.go @@ -24,13 +24,14 @@ type CallBack interface { // Connection TCP 连接 type Connection struct { + outBufferLen atomic.Int64 + inBufferLen atomic.Int64 + activeTime atomic.Int64 fd int connected atomic.Bool buffer *ringbuffer.RingBuffer outBuffer *ringbuffer.RingBuffer // write buffer inBuffer *ringbuffer.RingBuffer // read buffer - outBufferLen atomic.Int64 - inBufferLen atomic.Int64 callBack CallBack loop *eventloop.EventLoop peerAddr string @@ -38,7 +39,6 @@ type Connection struct { KeyValueContext idleTime time.Duration - activeTime atomic.Int64 timingWheel *timingwheel.TimingWheel timer at.Value protocol Protocol