make 64bit atomics also align on 32bit (#2386)
do this by simply putting them at the front of each struct see https://pkg.go.dev/sync/atomic#pkg-note-BUG fixes #2383 Co-authored-by: akarl10 <mike@mwys.mine.bz>
This commit is contained in:
+9
-5
@@ -80,6 +80,15 @@ type disconnectSignalOnResumeNoMessages struct {
|
||||
}
|
||||
|
||||
type Room struct {
|
||||
// atomics always need to be 64bit/8byte aligned
|
||||
// on 32bit arch only the beginning of the struct
|
||||
// starts at such a boundary.
|
||||
// time the first participant joined the room
|
||||
joinedAt atomic.Int64
|
||||
// time that the last participant left the room
|
||||
leftAt atomic.Int64
|
||||
holds atomic.Int32
|
||||
|
||||
lock sync.RWMutex
|
||||
|
||||
protoRoom *livekit.Room
|
||||
@@ -109,11 +118,6 @@ type Room struct {
|
||||
batchedUpdates map[livekit.ParticipantIdentity]*participantUpdate
|
||||
batchedUpdatesMu sync.Mutex
|
||||
|
||||
// time the first participant joined the room
|
||||
joinedAt atomic.Int64
|
||||
holds atomic.Int32
|
||||
// time that the last participant left the room
|
||||
leftAt atomic.Int64
|
||||
closed chan struct{}
|
||||
|
||||
trailer []byte
|
||||
|
||||
Reference in New Issue
Block a user