diff options
-rw-r--r-- | slicer/slicer/parser.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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 <Slice/CPlusPlusUtil.h> #include <boost/shared_ptr.hpp> #include <boost/filesystem/convenience.hpp> +#include <mutex> 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<std::string> cppArgs; + std::lock_guard<std::mutex> lock(slicePreprocessor); Slice::PreprocessorPtr icecpp = Slice::Preprocessor::create("slicer", ice.string(), cppArgs); FILE * cppHandle = icecpp->preprocess(false); |