diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2018-02-28 09:32:42 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-02-28 09:41:48 +0000 |
commit | 29994ea8ef88b898521eadbb5f7a5444ab46f6c0 (patch) | |
tree | c3af4aebc37de3d00cb23ea817cffc0fd4bee281 /src/lib/corelib/buildgraph/rulesevaluationcontext.cpp | |
parent | 78696cb39bbc9e6460c7d77fb9949fe2516ae4dd (diff) |
Guard QScriptEngine's creation/destruction with a mutex
When building multiple configurations in one go we create one
QScriptEngine per configuration, each in its own thread, but nearly at
the same time.
It turns out that QScriptEngine's creation/destruction is not
thread-safe, which leads to all kinds of interesting effects in the
multiple configurations case.
We fix this by guarding creation/destruction of QScriptEngine with a
mutex.
Task-number: QBS-1308
Change-Id: Ie01733d5943f1fb89e1d25344c4ffa998095e394
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/lib/corelib/buildgraph/rulesevaluationcontext.cpp')
-rw-r--r-- | src/lib/corelib/buildgraph/rulesevaluationcontext.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/corelib/buildgraph/rulesevaluationcontext.cpp b/src/lib/corelib/buildgraph/rulesevaluationcontext.cpp index 0b6774adb..c81e40c4f 100644 --- a/src/lib/corelib/buildgraph/rulesevaluationcontext.cpp +++ b/src/lib/corelib/buildgraph/rulesevaluationcontext.cpp @@ -55,7 +55,7 @@ namespace Internal { RulesEvaluationContext::RulesEvaluationContext(const Logger &logger) : m_logger(logger), - m_engine(new ScriptEngine(m_logger, EvalContext::RuleExecution)), + m_engine(ScriptEngine::create(m_logger, EvalContext::RuleExecution)), m_observer(nullptr), m_initScopeCalls(0) { |