diff options
author | Tor Lillqvist <tml@collabora.com> | 2013-11-13 10:50:12 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2013-11-20 18:23:04 +0000 |
commit | c0307ec2bafa0751e7d8ea1f4d6caac58c5cc5dc (patch) | |
tree | 9409294335033e5faf8999684b162301e6d8fd7b /sc/inc | |
parent | feca57d41d515959e3f730eb372a3d33bb251a03 (diff) |
WIP commit of threaded OpenCL compilation work
Change-Id: I210d0ded9cb38569b0831355522d8309cee05f56
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/clkernelthread.hxx | 16 | ||||
-rw-r--r-- | sc/inc/formulacell.hxx | 3 |
2 files changed, 18 insertions, 1 deletions
diff --git a/sc/inc/clkernelthread.hxx b/sc/inc/clkernelthread.hxx index c780c2852b9a..89ae860318f0 100644 --- a/sc/inc/clkernelthread.hxx +++ b/sc/inc/clkernelthread.hxx @@ -7,11 +7,21 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <queue> + #include <osl/conditn.hxx> #include <salhelper/thread.hxx> +#include "formulacell.hxx" + namespace sc { +struct CLBuildKernelWorkItem +{ + enum { COMPILE, FINISH } meWhatToDo; + ScFormulaCellGroupRef mxGroup; +}; + class CLBuildKernelThread : public salhelper::Thread { public: @@ -20,11 +30,15 @@ public: void finish(); + void push(CLBuildKernelWorkItem item); + protected: virtual void execute(); private: - osl::Condition maConsumeCondition; + osl::Mutex maMutex; + osl::Condition maCondition; + std::queue<CLBuildKernelWorkItem> maQueue; void produce(); void consume(); }; diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx index 4e56b6ab795d..68648fc1049a 100644 --- a/sc/inc/formulacell.hxx +++ b/sc/inc/formulacell.hxx @@ -53,6 +53,7 @@ struct SC_DLLPUBLIC ScFormulaCellGroup : boost::noncopyable mutable size_t mnRefCount; ScTokenArray* mpCode; + osl::Mutex maMutex; sc::CompiledFormula* mpCompiledFormula; ScFormulaCell *mpTopCell; SCROW mnLength; // How many of these do we have ? @@ -64,6 +65,8 @@ struct SC_DLLPUBLIC ScFormulaCellGroup : boost::noncopyable ScFormulaCellGroup(); ~ScFormulaCellGroup(); + void scheduleCompilation(); + void setCode( const ScTokenArray& rCode ); void compileCode( ScDocument& rDoc, const ScAddress& rPos, formula::FormulaGrammar::Grammar eGram ); |