diff options
| author | Will Hawkins <[email protected]> | 2022-06-04 04:02:07 -0400 |
|---|---|---|
| committer | Will Hawkins <[email protected]> | 2022-06-04 04:02:07 -0400 |
| commit | d38bea818a90a0ca2bfc17e96c00b9896e2c61ca (patch) | |
| tree | 7685d2d305276dc15e7a7ede9d244b78d9362c31 | |
| parent | eb8f1e7826c375b1ad8ea16e842451677d74df11 (diff) | |
[Bugfix #21] Bad alignment of elements in structs accessed atomically
Fixes #21
| -rw-r--r-- | lgc/lgc.go | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -40,12 +40,14 @@ type LoadGeneratingConnection interface { ClientId() uint64 } +// TODO: All 64-bit fields that are accessed atomically must +// appear at the top of this struct. type LoadGeneratingConnectionDownload struct { - Path string downloaded uint64 + lastIntervalEnd int64 + Path string downloadStartTime time.Time lastDownloaded uint64 - lastIntervalEnd int64 client *http.Client debug debug.DebugLevel valid bool @@ -312,12 +314,14 @@ func (lbd *LoadGeneratingConnectionDownload) doDownload(ctx context.Context) { } } +// TODO: All 64-bit fields that are accessed atomically must +// appear at the top of this struct. type LoadGeneratingConnectionUpload struct { - Path string uploaded uint64 + lastIntervalEnd int64 + Path string uploadStartTime time.Time lastUploaded uint64 - lastIntervalEnd int64 client *http.Client debug debug.DebugLevel valid bool |
