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