From: Richard Heck Date: Sun, 26 Oct 2014 16:53:41 +0000 (-0400) Subject: Make static variables used in DocBook output thread-safe. X-Git-Tag: 2.2.0alpha1~1597 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=452a7a500c78aeb04f5a2695a368cfdc1efd4c0d;p=features.git Make static variables used in DocBook output thread-safe. --- diff --git a/src/sgml.cpp b/src/sgml.cpp index fdd0ed7270..125ef611fa 100644 --- a/src/sgml.cpp +++ b/src/sgml.cpp @@ -26,6 +26,7 @@ #include "support/docstream.h" #include "support/lstrings.h" #include "support/textutils.h" +#include "support/ThreadStorage.h" #include @@ -135,10 +136,11 @@ docstring sgml::cleanID(Buffer const & buf, OutputParams const & runparams, docstring content; - // FIXME THREAD typedef map MangledMap; - static MangledMap mangledNames; - static int mangleID = 1; + static ThreadStorage tMangledNames; + MangledMap & mangledNames = *tMangledNames; + static ThreadStorage tMangleID; + int & mangleID = *tMangleID; MangledMap::const_iterator const known = mangledNames.find(orig); if (known != mangledNames.end())