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

Update Logger.cpp #51

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Update Logger.cpp #51

wants to merge 3 commits into from

Conversation

u6th9d
Copy link

@u6th9d u6th9d commented Oct 9, 2018

Should not lose the log :)

u6th9d added 2 commits October 9, 2018 16:46
Should not lose the log :)
} else {
return nullptr;
Copy link
Member

Choose a reason for hiding this comment

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

The only condtion arrive here is mStop==true, so we should abandon this log then quit asap

Copy link
Author

Choose a reason for hiding this comment

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

The current worker thread may also be woken up when other worker threads call the Logger::gInst::put method. Because two queues share the same condition variable.

Copy link
Author

Choose a reason for hiding this comment

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

I think that two queues should each have their own locks and condition variables instead of sharing the same lock and the same condition variable.

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