24#include <osl/interlck.h>
51 explicit ThreadManager( css::uno::Reference< css::util::XJobManager >
const & rThreadJoiner );
68 const ::rtl::Reference< ObservableThread >& rThread );
71 const bool bThreadFinished =
false );
82 std::unique_lock aGuard(
maMutex);
93 std::unique_lock aGuard(
maMutex);
102 css::uno::Reference< css::util::XCancellable >
aJob;
144 bool StartThread(
const tThreadData& aThreadData );
interface class to listen on the finish of a thread
helper class to observe threads
std::deque< tThreadData > maStartedThreads
std::shared_ptr< ThreadListener > mpThreadListener
void SuspendStartingOfThreads()
suspend the starting of threads
bool StartThread(const tThreadData &aThreadData)
oslInterlockedCount mnThreadIDCounter
std::deque< tThreadData > maWaitingForStartThreads
void ResumeStartingOfThreads()
continues the starting of threads after it has been suspended
bool StartingOfThreadsSuspended()
css::uno::WeakReference< css::util::XJobManager > mrThreadJoiner
bool StartWaitingThread()
static const std::deque< tThreadData >::size_type snStartedSize
class to manage threads
ThreadManager(css::uno::Reference< css::util::XJobManager > const &rThreadJoiner)
oslInterlockedCount AddThread(const ::rtl::Reference< ObservableThread > &rThread)
add thread to the thread manager and taking ownership for the thread
void Init()
initialization
Idle maStartNewThreadIdle
bool mbStartingOfThreadsSuspended
std::weak_ptr< IFinishedThreadListener > GetThreadListenerWeakRef() const
DECL_LINK(TryToStartNewThread, Timer *, void)
void NotifyAboutFinishedThread(const oslInterlockedCount nThreadID)
void RemoveThread(const oslInterlockedCount nThreadID, const bool bThreadFinished=false)
oslInterlockedCount mnThreadID
ThreadPred(oslInterlockedCount nThreadID)
bool operator()(const tThreadData &rThreadData) const
css::uno::Reference< css::util::XCancellable > aJob
::rtl::Reference< ObservableThread > pThread
oslInterlockedCount nThreadID