Skip to content

Commit 412981c

Browse files
Psychotroposjohnweldon
authored andcommitted
conn: Ensure 64-bit alignment for atomics on 32-bit platforms
1 parent 5c2c0f9 commit 412981c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

conn.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ const (
8585

8686
// Conn represents an LDAP Connection
8787
type Conn struct {
88+
// requestTimeout is loaded atomically
89+
// so we need to ensure 64-bit alignment on 32-bit platforms.
90+
requestTimeout int64
8891
conn net.Conn
8992
isTLS bool
9093
closing uint32
@@ -98,7 +101,6 @@ type Conn struct {
98101
wgClose sync.WaitGroup
99102
outstandingRequests uint
100103
messageMutex sync.Mutex
101-
requestTimeout int64
102104
}
103105

104106
var _ Client = &Conn{}

0 commit comments

Comments
 (0)