1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_CPPU_SOURCE_THREADPOOL_THREAD_HXX
20 #define INCLUDED_CPPU_SOURCE_THREADPOOL_THREAD_HXX
22 #include <osl/thread.hxx>
23 #include <sal/types.h>
24 #include <salhelper/simplereferenceobject.hxx>
26 #include "jobqueue.hxx"
27 #include "threadpool.hxx"
29 namespace cppu_threadpool
{
34 // private thread class for the threadpool
37 public salhelper::SimpleReferenceObject
, public osl::Thread
40 ORequestThread( ThreadPoolHolder
const &aThreadPool
,
42 const ::rtl::ByteSequence
&aThreadId
,
44 virtual ~ORequestThread();
46 void setTask( JobQueue
* , const ::rtl::ByteSequence
& aThreadId
, bool bAsynchron
);
50 static inline void * operator new(std::size_t size
)
51 { return SimpleReferenceObject::operator new(size
); }
53 static inline void operator delete(void * pointer
)
54 { SimpleReferenceObject::operator delete(pointer
); }
57 virtual void SAL_CALL
run() SAL_OVERRIDE
;
58 virtual void SAL_CALL
onTerminated() SAL_OVERRIDE
;
60 ThreadPoolHolder m_aThreadPool
;
62 ::rtl::ByteSequence m_aThreadId
;
66 } // end cppu_threadpool
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */