Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Mantid::Kernel::ThreadPoolRunnable Class Reference

ThreadPoolRunnable : Class used by thread pool (and POCO) to run inside a thread. More...

#include <ThreadPoolRunnable.h>

Inheritance diagram for Mantid::Kernel::ThreadPoolRunnable:

Public Member Functions

void clearWait ()
 Clear the wait time of the runnable so that it stops waiting for tasks. More...
 
void run () override
 Thread method. More...
 
size_t threadnum ()
 Return the thread number of this thread. More...
 
 ThreadPoolRunnable (size_t threadnum, ThreadScheduler *scheduler, ProgressBase *prog=nullptr, double waitSec=0.0)
 Constructor. More...
 

Private Attributes

ProgressBasem_prog
 Progress reporter. More...
 
ThreadSchedulerm_scheduler
 The ThreadScheduler instance taking care of task scheduling. More...
 
size_t m_threadnum
 ID of this thread. More...
 
double m_waitSec
 How many seconds you are allowed to wait with no tasks before exiting. More...
 

Detailed Description

ThreadPoolRunnable : Class used by thread pool (and POCO) to run inside a thread.

Author
Janik Zikovsky
Date
2011-02-23

Definition at line 24 of file ThreadPoolRunnable.h.

Constructor & Destructor Documentation

◆ ThreadPoolRunnable()

Mantid::Kernel::ThreadPoolRunnable::ThreadPoolRunnable ( size_t  threadnum,
ThreadScheduler scheduler,
ProgressBase prog = nullptr,
double  waitSec = 0.0 
)

Constructor.

Parameters
threadnum:: the thread ID that this runnable is running in.
scheduler:: ThreadScheduler used by the thread pool
prog:: optional pointer to a Progress reporter object. If passed, then automatic progress reporting will be handled by the thread pool.
waitSec:: how many seconds the thread is allowed to wait with no tasks.

Definition at line 27 of file ThreadPoolRunnable.cpp.

References m_scheduler.

Member Function Documentation

◆ clearWait()

void Mantid::Kernel::ThreadPoolRunnable::clearWait ( )

Clear the wait time of the runnable so that it stops waiting for tasks.

Definition at line 35 of file ThreadPoolRunnable.cpp.

References m_waitSec.

◆ run()

void Mantid::Kernel::ThreadPoolRunnable::run ( )
override

◆ threadnum()

size_t Mantid::Kernel::ThreadPoolRunnable::threadnum ( )
inline

Return the thread number of this thread.

Definition at line 29 of file ThreadPoolRunnable.h.

Member Data Documentation

◆ m_prog

ProgressBase* Mantid::Kernel::ThreadPoolRunnable::m_prog
private

Progress reporter.

Definition at line 43 of file ThreadPoolRunnable.h.

Referenced by run().

◆ m_scheduler

ThreadScheduler* Mantid::Kernel::ThreadPoolRunnable::m_scheduler
private

The ThreadScheduler instance taking care of task scheduling.

Definition at line 40 of file ThreadPoolRunnable.h.

Referenced by run(), and ThreadPoolRunnable().

◆ m_threadnum

size_t Mantid::Kernel::ThreadPoolRunnable::m_threadnum
private

ID of this thread.

Definition at line 37 of file ThreadPoolRunnable.h.

Referenced by run().

◆ m_waitSec

double Mantid::Kernel::ThreadPoolRunnable::m_waitSec
private

How many seconds you are allowed to wait with no tasks before exiting.

Definition at line 46 of file ThreadPoolRunnable.h.

Referenced by clearWait(), and run().


The documentation for this class was generated from the following files: