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 CommandScheduler #681

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chros73
Copy link
Contributor

@chros73 chros73 commented Jan 24, 2018

Patched by @pyroscope.

Relates to: #515

@rakshasa
Copy link
Owner

This isn't the fix you are looking for.

It doesn't address the race condition as the scheduler isn't a thread-safe container, and at best you hide the issue a bit.

The scheduler is only ever supposed to be called while in the main thread, or updated while the global lock is being held by a particular thread.

If there's an issue it might be due to the worker thread starting in main.cc before the main thread.

@chros73
Copy link
Contributor Author

chros73 commented Jan 31, 2018

It doesn't address the race condition ... If there's an issue it might be due to the worker thread starting in main.cc before the main thread.

Ok, thanks for the explanation.
I modified "Closes" to "Relates to" in the description.

... at best you hide the issue a bit.

Well, it prevents crashing. You can modify the title of this pull request if you still feel that this is useful.

@rakshasa
Copy link
Owner

To debug this we probably should add a check to see if the thread calling the command holds the global lock.

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