diff options
author | Tor Lillqvist <tml@collabora.com> | 2013-11-28 10:59:16 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2013-11-28 15:12:10 +0200 |
commit | 78d1f562685c9bb8cd24d272b48e9d2d8c086308 (patch) | |
tree | f0dd6462cbbfb199af04d33c3998931041e18e60 /sc/inc | |
parent | f7ef84640258e4ee6ddc4cc5cbf58a2d89860afa (diff) |
Background OpenCL compilation re-factoring
Don't use a mutex and condition in each ScFormulaCellGroup.
Not sure at all if this crack works, and I hate every moment spent on it, but
at least it is still behind an environment variable.
Change-Id: I70c917d47112e3a2ed010de4d123a4155f71c004
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/clkernelthread.hxx | 16 | ||||
-rw-r--r-- | sc/inc/formulacell.hxx | 6 |
2 files changed, 15 insertions, 7 deletions
diff --git a/sc/inc/clkernelthread.hxx b/sc/inc/clkernelthread.hxx index 89ae860318f0..8018d3f68a3e 100644 --- a/sc/inc/clkernelthread.hxx +++ b/sc/inc/clkernelthread.hxx @@ -7,11 +7,17 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#ifndef INCLUDED_SC_INC_CLKERNELTHREAD_HXX +#define INCLUDED_SC_INC_CLKERNELTHREAD_HXX + #include <queue> #include <osl/conditn.hxx> #include <salhelper/thread.hxx> +#include <boost/noncopyable.hpp> + +#include "scdllapi.h" #include "formulacell.hxx" namespace sc { @@ -22,7 +28,7 @@ struct CLBuildKernelWorkItem ScFormulaCellGroupRef mxGroup; }; -class CLBuildKernelThread : public salhelper::Thread +class SC_DLLPUBLIC CLBuildKernelThread : public salhelper::Thread, boost::noncopyable { public: CLBuildKernelThread(); @@ -32,12 +38,14 @@ public: void push(CLBuildKernelWorkItem item); + osl::Condition maCompilationDoneCondition; + protected: virtual void execute(); private: - osl::Mutex maMutex; - osl::Condition maCondition; + osl::Mutex maQueueMutex; + osl::Condition maQueueCondition; std::queue<CLBuildKernelWorkItem> maQueue; void produce(); void consume(); @@ -45,4 +53,6 @@ private: } +#endif // INCLUDED_SC_INC_CLKERNELTHREAD_HXX + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx index 656eebb49ac4..dbb52e45b107 100644 --- a/sc/inc/formulacell.hxx +++ b/sc/inc/formulacell.hxx @@ -57,8 +57,6 @@ struct SC_DLLPUBLIC ScFormulaCellGroup : boost::noncopyable mutable size_t mnRefCount; ScTokenArray* mpCode; - osl::Mutex maMutex; - osl::Condition maCompilationDone; sc::CompiledFormula* mpCompiledFormula; ScFormulaCell *mpTopCell; SCROW mnLength; // How many of these do we have ? @@ -76,8 +74,8 @@ struct SC_DLLPUBLIC ScFormulaCellGroup : boost::noncopyable void compileCode( ScDocument& rDoc, const ScAddress& rPos, formula::FormulaGrammar::Grammar eGram ); - static int mnCount; - static rtl::Reference<sc::CLBuildKernelThread> mxCLKernelThread; + static int snCount; + static rtl::Reference<sc::CLBuildKernelThread> sxCompilationThread; }; inline void intrusive_ptr_add_ref(const ScFormulaCellGroup *p) |