Skip to content

Commit

Permalink
Reorder fields on worker.Scheduler
Browse files Browse the repository at this point in the history
This will hopefully fix a segfault under 32bit platforms caused
by unaligned access to 64bit values.

golang/go#23345
  • Loading branch information
tyler-sommer committed May 9, 2018
1 parent 2ec1d7f commit 0934e78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ func (j JobFunc) Perform() error {

// Scheduler is the entry-point for scheduling jobs to run asynchronously.
type Scheduler struct {
workers int64 // Number of active worker goroutines.

delay time.Duration // Delay between ticks.

waiting chan Job // Jobs ready to be performed.
Expand All @@ -40,8 +42,6 @@ type Scheduler struct {
quit chan struct{} // Closed when shutting down.
done chan struct{} // Closed when finished shutting down.

workers int64 // Number of active worker goroutines.

logger log.Logger

// Acceptable time to wait before forcefully quitting when shutting down
Expand Down

0 comments on commit 0934e78

Please sign in to comment.