From 5262ff500c3c7a5c6f18db098753f8ee587bd603 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 7 Dec 2014 15:12:22 +0000 Subject: Add mutex around Slice::Preprocessor calls as they seem to be demonstrably not thread safe --- slicer/slicer/parser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/slicer/slicer/parser.cpp b/slicer/slicer/parser.cpp index 299b178..c7dcec2 100644 --- a/slicer/slicer/parser.cpp +++ b/slicer/slicer/parser.cpp @@ -9,9 +9,12 @@ #include #include #include +#include namespace fs = boost::filesystem; +std::mutex slicePreprocessor; + namespace Slicer { Slicer::Slicer(FILE * c) : components(0), @@ -506,6 +509,7 @@ namespace Slicer { Slicer::Apply(const boost::filesystem::path & ice, FILE * cpp) { std::vector cppArgs; + std::lock_guard lock(slicePreprocessor); Slice::PreprocessorPtr icecpp = Slice::Preprocessor::create("slicer", ice.string(), cppArgs); FILE * cppHandle = icecpp->preprocess(false); -- cgit v1.2.3