12#include "MantidKernel/DllConfig.h"
29class MANTID_KERNEL_DLL
Task {
40 Task(
double cost) : m_cost(cost) {}
47 virtual void run() = 0;
53 virtual double cost() {
return m_cost; }
72 std::shared_ptr<std::mutex>
getMutex() {
return m_mutex; }
78 void setMutex(
const std::shared_ptr<std::mutex> &mutex) { m_mutex = mutex; }
#define UNUSED_ARG(x)
Function arguments are sometimes unused in certain implmentations but are required for documentation ...
Marks code as not implemented yet.
A Task is a unit of work to be scheduled and run by a ThreadPool.
Task()
Default constructor.
virtual double cost()
What is the computational cost of this task?
std::shared_ptr< std::mutex > m_mutex
Mutex associated with this task (can be NULL)
virtual ~Task()=default
Destructor.
void setMutexObject(void *object)
Use an arbitrary pointer to lock (mutex) the execution of this task.
double m_cost
Cached computational cost for the thread.
void setMutex(const std::shared_ptr< std::mutex > &mutex)
Set the mutex object for this Task.
std::shared_ptr< std::mutex > getMutex()
Get the mutex object for this Task.
virtual void run()=0
Main method that performs the work for the task.
Task(double cost)
Constructor with cost.
Helper class which provides the Collimation Length for SANS instruments.