I think there is a bug in NestedDiagnosticContext or ThreadLocalStorage. Example code
- Code: Select all
#include <Poco/NestedDiagnosticContext.h>
#include <Poco/Thread.h>
#include <Poco/RunnableAdapter.h>
struct Dummy
{
void f()
{
poco_ndc(f);
Poco::Thread::sleep(1000);
}
};
int main(int argc, char** argv[])
{
Dummy d;
Poco::RunnableAdapter<Dummy> ra(d, &Dummy::f);
for (;;)
{
Poco::Thread th;
th.start(ra);
Poco::Thread::sleep(100);
}
return 0;
}
causes Access Violation deep in NDCScope destructor. I use Visual Studion 2008 compiler. Unfotunatly, Im not very expirienced in concurrency in C++ and can't find bug by myaself. Any idea how to fix it?





