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 race condition in task scheduler #1763

Merged
merged 1 commit into from
Oct 18, 2021

Conversation

lodoyun
Copy link
Contributor

@lodoyun lodoyun commented Oct 18, 2021

Description
This PR fixes a concurrency issue that could cause scheduled tasks to be executed before their time.
This problem would occur whenever two threads were waiting for the same task (same timeout) at the same time.
As a bonus, I've replaced the system_clock for a steady_clock which is better in this case since we're always calculating time differences.

  • It needs and includes Unit Tests

Changes in Client or Server public APIs

[] It includes documentation for these changes in /doc.

Copy link
Contributor

@jcague jcague left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lodoyun lodoyun merged commit 10414fa into lynckia:master Oct 18, 2021
@lodoyun lodoyun deleted the fix/schedulerIssue branch October 18, 2021 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants