Skip to content

Update Logger.cpp#51

Open
u6th9d wants to merge 3 commits into
joyieldInc:masterfrom
u6th9d:patch-1
Open

Update Logger.cpp#51
u6th9d wants to merge 3 commits into
joyieldInc:masterfrom
u6th9d:patch-1

Conversation

@u6th9d
Copy link
Copy Markdown

@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 :)
Comment thread src/Logger.cpp
++mLogUnitCnt;
break;
} else {
return nullptr;
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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