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

Replaced Queue with ConcurrentQueue. #58

Merged
merged 3 commits into from
Feb 1, 2021

Conversation

DenchiSoft
Copy link
Contributor

This seems to solve the concurrency issues reported in #42

Copy link
Member

@swiftyspiffy swiftyspiffy left a comment

Choose a reason for hiding this comment

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

Thoughts on using IsEmpty instead of the output from TryDequeue? As far as I understand, it might be slightly more efficient, and since this code is run on every frame, this might make sense.

Something like:

while(!_executionQueue.IsEmpty) {
     Action action;
     if(_executionQueue.TryDequeue(out action)) {
             action.Invoke();
     }
}

@DenchiSoft
Copy link
Contributor Author

Looks good to me. Definitely a bit cleaner.

@DenchiSoft DenchiSoft closed this Jan 30, 2021
@DenchiSoft DenchiSoft reopened this Jan 30, 2021
Copy link
Member

@swiftyspiffy swiftyspiffy left a comment

Choose a reason for hiding this comment

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

lgtm, nj

@swiftyspiffy swiftyspiffy merged commit 30c6b26 into TwitchLib:master Feb 1, 2021
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