diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-09-11 18:13:51 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-09-11 18:15:37 +0200 |
commit | 31d606d42d3f2b0577c74af5778778c975d519ae (patch) | |
tree | c56f05ecea47b988bf989d9184489eca9adb3f55 | |
parent | Fix further data race during CppunitTest_filter_xslt (diff) | |
download | core-31d606d42d3f2b0577c74af5778778c975d519ae.tar.gz core-31d606d42d3f2b0577c74af5778778c975d519ae.zip |
...and fix previous commit cd8aeed1569222edd8bfd05d9d833f74b679fcd0
"Fix data races during CppunitTest_filter_xslt". (Funny how after each
attempted fix, 'make CppunitTest_filter_xslt' succeeded multiple times in a row,
and only started to fail ThreadSanitizer after pushing the attempted fix.)
Change-Id: I24cab2dd1b068b02ccd4827cf8dcb11cf301d1c0
-rw-r--r-- | filter/source/xsltfilter/LibXSLTTransformer.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/filter/source/xsltfilter/LibXSLTTransformer.cxx b/filter/source/xsltfilter/LibXSLTTransformer.cxx index 869643003edb..0fc7e434c1ea 100644 --- a/filter/source/xsltfilter/LibXSLTTransformer.cxx +++ b/filter/source/xsltfilter/LibXSLTTransformer.cxx @@ -364,17 +364,13 @@ namespace XSLT void Reader::forceStateStopped() { - xsltTransformContextPtr tcontext; - { - std::unique_lock<std::mutex> g(m_mutex); - tcontext = m_tcontext; - } - if (!tcontext) + std::unique_lock<std::mutex> g(m_mutex); + if (!m_tcontext) return; //tdf#100057 If we force a cancel, libxslt will of course just keep on going unless something //tells it to stop. Here we force the stopped state so that libxslt will stop processing //and so Reader::execute will complete and we can join cleanly - tcontext->state = XSLT_STATE_STOPPED; + m_tcontext->state = XSLT_STATE_STOPPED; } Reader::~Reader() |