Skip to content

fix(NestedDiagnosticContext): NDC crashed in multi-thread environment#4667

Closed
siren186 wants to merge 5 commits intopocoproject:mainfrom
siren186:fix/NestedDiagnosticContext
Closed

fix(NestedDiagnosticContext): NDC crashed in multi-thread environment#4667
siren186 wants to merge 5 commits intopocoproject:mainfrom
siren186:fix/NestedDiagnosticContext

Conversation

@siren186
Copy link
Copy Markdown
Member

@siren186 siren186 commented Sep 6, 2024

Copy link
Copy Markdown
Member

@aleks-f aleks-f left a comment

Choose a reason for hiding this comment

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

I'm not sure this is the solution to the problem

@siren186 siren186 requested a review from aleks-f September 11, 2024 01:57
…rd thread_local so that objects can dtor when thread exit
@siren186
Copy link
Copy Markdown
Member Author

@aleks-f I found that thread_local is better than Poco::ThreadLocal, because thread_local variable will call dtor when thread exit. but Poco::ThreadLocal not.

assertTrue (NDC::current().depth() == 3);
NDC::current().dump(std::cout);
std::ostringstream ostr;
NDC::current().dump(ostr);
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.

I guess it would make sense to verify here that the output is correct.

@aleks-f aleks-f mentioned this pull request Sep 11, 2024
@aleks-f
Copy link
Copy Markdown
Member

aleks-f commented Sep 11, 2024

replaced with #4674 to trigger all CI

@aleks-f aleks-f closed this Sep 11, 2024
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.

NestedDiagnosticContext should be thread local

2 participants