summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--project2/ice/sliceCompile.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/project2/ice/sliceCompile.cpp b/project2/ice/sliceCompile.cpp
index 32831ac..b879965 100644
--- a/project2/ice/sliceCompile.cpp
+++ b/project2/ice/sliceCompile.cpp
@@ -1,6 +1,9 @@
#include <pch.hpp>
#include "sliceCompile.h"
#include <scopeObject.h>
+#include <mutex>
+
+std::mutex slicePreprocessor;
SliceCompile::SliceCompile(const boost::filesystem::path & slice, const IceCompile::Deps & dep) :
IceCompile(slice, dep)
@@ -11,6 +14,7 @@ unsigned int
SliceCompile::build(const boost::filesystem::path & in, FILE * out) const
{
std::vector<std::string> cppArgs;
+ std::lock_guard<std::mutex> lock(slicePreprocessor);
Slice::PreprocessorPtr icecpp = Slice::Preprocessor::create("slice2project2", in.string(), cppArgs);
FILE * cppHandle = icecpp->preprocess(false);