summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-10-07 18:22:53 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-10-07 18:22:53 (GMT)
commiteb982771caed944f441967194df86ddbec21efde (patch)
treee76ab6fccb3e88898d9bb1eb4c8866d6ebdcbb5d /Swiften/Parser/LibXMLParser.h
parent6b98253a4127c975bd59b6a49ddb203337a8c32b (diff)
downloadswift-contrib-eb982771caed944f441967194df86ddbec21efde.zip
swift-contrib-eb982771caed944f441967194df86ddbec21efde.tar.bz2
Initialize LibXML for multithreaded applications.
Diffstat (limited to 'Swiften/Parser/LibXMLParser.h')
-rw-r--r--Swiften/Parser/LibXMLParser.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Swiften/Parser/LibXMLParser.h b/Swiften/Parser/LibXMLParser.h
index ba61ad9..cd73637 100644
--- a/Swiften/Parser/LibXMLParser.h
+++ b/Swiften/Parser/LibXMLParser.h
@@ -12,6 +12,10 @@
#include <Swiften/Parser/XMLParser.h>
namespace Swift {
+ /**
+ * Warning: This constructor is not thread-safe, because it depends on global state to
+ * check whether it is initialized.
+ */
class LibXMLParser : public XMLParser, public boost::noncopyable {
public:
LibXMLParser(XMLParserClient* client);
@@ -20,6 +24,7 @@ namespace Swift {
bool parse(const std::string& data);
private:
+ static bool initialized;
xmlSAXHandler handler_;
xmlParserCtxtPtr context_;
};