From 452a7a500c78aeb04f5a2695a368cfdc1efd4c0d Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sun, 26 Oct 2014 12:53:41 -0400 Subject: [PATCH] Make static variables used in DocBook output thread-safe. --- src/sgml.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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()) -- 2.39.2