Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / inc / clkernelthread.hxx
blob8018d3f68a3e8dd5cc735fa29e88321380ea84d4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #ifndef INCLUDED_SC_INC_CLKERNELTHREAD_HXX
11 #define INCLUDED_SC_INC_CLKERNELTHREAD_HXX
13 #include <queue>
15 #include <osl/conditn.hxx>
16 #include <salhelper/thread.hxx>
18 #include <boost/noncopyable.hpp>
20 #include "scdllapi.h"
21 #include "formulacell.hxx"
23 namespace sc {
25 struct CLBuildKernelWorkItem
27 enum { COMPILE, FINISH } meWhatToDo;
28 ScFormulaCellGroupRef mxGroup;
31 class SC_DLLPUBLIC CLBuildKernelThread : public salhelper::Thread, boost::noncopyable
33 public:
34 CLBuildKernelThread();
35 virtual ~CLBuildKernelThread();
37 void finish();
39 void push(CLBuildKernelWorkItem item);
41 osl::Condition maCompilationDoneCondition;
43 protected:
44 virtual void execute();
46 private:
47 osl::Mutex maQueueMutex;
48 osl::Condition maQueueCondition;
49 std::queue<CLBuildKernelWorkItem> maQueue;
50 void produce();
51 void consume();
56 #endif // INCLUDED_SC_INC_CLKERNELTHREAD_HXX
58 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */