rclone icon indicating copy to clipboard operation
rclone copied to clipboard

rc/job: use mutex for adding listeners thread safety

Open hayden-pan opened this issue 1 year ago • 0 comments

Fix in extreme cases, when the job is executing finish(), the listener added by calling OnFinish() will never be executed.

This change should not cause compatibility issues, as consumers should not make assumptions about whether listeners will be run in a new goroutine

What is the purpose of this change?

Was the change discussed in an issue or in the forum before?

Checklist

  • [x] I have read the contribution guidelines.
  • [x] I have added tests for all changes in this PR if appropriate.
  • [ ] I have added documentation for the changes if appropriate.
  • [x] All commit messages are in house style.
  • [x] I'm done, this Pull Request is ready for review :-)

hayden-pan avatar Oct 10 '24 13:10 hayden-pan