Skip to content

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 :)
++mLogUnitCnt;
break;
} 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