summaryrefslogtreecommitdiff
path: root/sc/inc
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2013-11-08 10:16:39 +0200
committerMichael Meeks <michael.meeks@collabora.com>2013-11-20 18:23:03 +0000
commit723060d4b301e80bf6390422a0e82d56ab8e1fd3 (patch)
tree15286ea07b9ee42289c0ca8fddc8c31fcc0a9f55 /sc/inc
parent89f8829a62479c6d6deb1ffaab1baf710c8cc856 (diff)
WIP: Do OpenCL compilation in advance in a worker thread
Change-Id: I9fbf848bd487e5ea49a383461f04e3c1678af607
Diffstat (limited to 'sc/inc')
-rw-r--r--sc/inc/clkernelthread.hxx34
-rw-r--r--sc/inc/formulacell.hxx5
2 files changed, 39 insertions, 0 deletions
diff --git a/sc/inc/clkernelthread.hxx b/sc/inc/clkernelthread.hxx
new file mode 100644
index 000000000000..c780c2852b9a
--- /dev/null
+++ b/sc/inc/clkernelthread.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <osl/conditn.hxx>
+#include <salhelper/thread.hxx>
+
+namespace sc {
+
+class CLBuildKernelThread : public salhelper::Thread
+{
+public:
+ CLBuildKernelThread();
+ virtual ~CLBuildKernelThread();
+
+ void finish();
+
+protected:
+ virtual void execute();
+
+private:
+ osl::Condition maConsumeCondition;
+ void produce();
+ void consume();
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index b32f25066ce5..c151e06a80c2 100644
--- a/sc/inc/formulacell.hxx
+++ b/sc/inc/formulacell.hxx
@@ -23,6 +23,7 @@
#include "formularesult.hxx"
#include "formula/tokenarray.hxx"
+#include <rtl/ref.hxx>
#include "svl/listener.hxx"
#include "types.hxx"
@@ -31,6 +32,7 @@
namespace sc {
+class CLBuildKernelThread;
class StartListeningContext;
class EndListeningContext;
struct RefUpdateContext;
@@ -69,6 +71,9 @@ struct SC_DLLPUBLIC ScFormulaCellGroup : boost::noncopyable
void setCode( const ScTokenArray& rCode );
void compileCode(
ScDocument& rDoc, const ScAddress& rPos, formula::FormulaGrammar::Grammar eGram );
+
+ static int mnCount;
+ static rtl::Reference<sc::CLBuildKernelThread> mxCLKernelThread;
};
inline void intrusive_ptr_add_ref(const ScFormulaCellGroup *p)