Skip to content

Commit

Permalink
fix: data race for isStarted (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfyiamcool committed Aug 18, 2023
1 parent 88a785b commit 87082ee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions quartz/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ func (sched *StdScheduler) Wait(ctx context.Context) {

// IsStarted determines whether the scheduler has been started.
func (sched *StdScheduler) IsStarted() bool {
sched.mtx.Lock()
defer sched.mtx.Unlock()

return sched.started
}

Expand Down

0 comments on commit 87082ee

Please sign in to comment.