summaryrefslogtreecommitdiffstats
path: root/sc/inc/clkernelthread.hxx
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2013-11-28 10:59:16 +0200
committerTor Lillqvist <tml@collabora.com>2013-11-28 15:12:10 +0200
commit78d1f562685c9bb8cd24d272b48e9d2d8c086308 (patch)
treef0dd6462cbbfb199af04d33c3998931041e18e60 /sc/inc/clkernelthread.hxx
parentabi#2128 RTF import: fix memory leak (diff)
downloadcore-78d1f562685c9bb8cd24d272b48e9d2d8c086308.tar.gz
core-78d1f562685c9bb8cd24d272b48e9d2d8c086308.zip
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/clkernelthread.hxx')
-rw-r--r--sc/inc/clkernelthread.hxx16
1 files changed, 13 insertions, 3 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: */