multi: 64bit aligment of atomic vars on arm/x86-32
This commit is contained in:
1 parent
d2bcb708f3
commit
3be08e69cf
21 files changed
+67
-60
No files matched your search
+13
-13
@@ -17,6 +17,19 @@ import (
|
||||
// to signal the number of slots available, and a condition variable to allow
|
||||
// the packetQueue to know when new items have been added to the queue.
|
||||
type packetQueue struct {
|
||||
// queueLen is an internal counter that reflects the size of the queue
|
||||
// at any given instance. This value is intended to be use atomically
|
||||
// as this value is used by internal methods to obtain the length of
|
||||
// the queue w/o grabbing the main lock. This allows callers to avoid a
|
||||
// deadlock situation where the main goroutine is attempting a send
|
||||
// with the lock held.
|
||||
queueLen int32
|
||||
|
||||
// totalHtlcAmt is the sum of the value of all pending HTLC's currently
|
||||
// residing within the overflow queue. This value should only read or
|
||||
// modified *atomically*.
|
||||
totalHtlcAmt int64
|
||||
|
||||
queue []*htlcPacket
|
||||
|
||||
wg sync.WaitGroup
|
||||
@@ -33,20 +46,7 @@ type packetQueue struct {
|
||||
// commitment transaction.
|
||||
outgoingPkts chan *htlcPacket
|
||||
|
||||
// totalHtlcAmt is the sum of the value of all pending HTLC's currently
|
||||
// residing within the overflow queue. This value should only read or
|
||||
// modified *atomically*.
|
||||
totalHtlcAmt int64
|
||||
|
||||
quit chan struct{}
|
||||
|
||||
// queueLen is an internal counter that reflects the size of the queue
|
||||
// at any given instance. This value is intended to be use atomically
|
||||
// as this value is used by internal methods to obtain the length of
|
||||
// the queue w/o grabbing the main lock. This allows callers to avoid a
|
||||
// deadlock situation where the main goroutine is attempting a send
|
||||
// with the lock held.
|
||||
queueLen int32
|
||||
}
|
||||
|
||||
// newPacketQueue returns a new instance of the packetQueue. The maxFreeSlots
|
||||
|
||||
Reference in new issue
Block a user