Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix diode issue with atomic.AddUint64 in 32-bit #229

Merged
merged 1 commit into from May 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion diode/internal/diodes/many_to_one.go
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion diode/internal/diodes/one_to_one.go
Expand Up @@ -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
}

Expand Down