fix(diode): atomic.AddUint64 in 32-bit cause panic (#229)
see: https://golang.org/pkg/sync/atomic/#pkg-note-BUG
This commit is contained in:
parent
de5a95dced
commit
e86e8f2f49
|
@ -9,9 +9,9 @@ import (
|
|||
// ManyToOne diode is optimal for many writers (go-routines B-n) and a single
|
||||
// reader (go-routine A). It is not thread safe for multiple readers.
|
||||
type ManyToOne struct {
|
||||
buffer []unsafe.Pointer
|
||||
writeIndex uint64
|
||||
readIndex uint64
|
||||
buffer []unsafe.Pointer
|
||||
alerter Alerter
|
||||
}
|
||||
|
||||
|
|
|
@ -31,9 +31,9 @@ type bucket struct {
|
|||
// OneToOne diode is meant to be used by a single reader and a single writer.
|
||||
// It is not thread safe if used otherwise.
|
||||
type OneToOne struct {
|
||||
buffer []unsafe.Pointer
|
||||
writeIndex uint64
|
||||
readIndex uint64
|
||||
buffer []unsafe.Pointer
|
||||
alerter Alerter
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue