I my code 2 different threads at the same time called xercesc code.
T1: new SAXParser();
T2: XMLPlatformUtils::Initialize();
They both called a function with this code:
{
try {
XMLPlatformUtils::Initialize();
}
catch (const XMLException& toCatch) {
char* message = XMLString::transcode(toCatch.getMessage());
std::cout << "Error during initialization! :\n"
<< message << "\n";
XMLString::release(&message);
return;
}
const char xmlFile[] = "file.xml";
_parser = new SAXParser();
...
}
_parser is a global variable.
The code crashes when one thread is in Initalize(); and the other
thread is in new SAXParser();
They both call some XMemory code.
Any comment on the thread safeness of the Xerces?
}