LAMA
lama::LAMAThreadTask Struct Reference

Structure that specifies worker task and its state. More...

#include <LAMAThreadPool.hpp>

Public Types

enum  TaskState { DEFINED, QUEUED, RUNNING, FINISHED }

Static Public Member Functions

static boost::shared_ptr
< LAMAThreadTask
create (boost::function< void()> work, unsigned int taskId, int numOmpThreads=0)
 Create a new task as a shared pointer.

Data Fields

boost::function< void()> mWork
 task function to be executed
volatile TaskState mState
 current state of the task
bool mException
 true if task got an exception
unsigned int mTaskId
 unique task id
int ompThreads
 number of OpenMP threads to be used

Detailed Description

Structure that specifies worker task and its state.

As this structure might be used either by a running thread or by the thread that issued the task it should always be used via a shared pointer so that ownership never matters.


Member Enumeration Documentation

Enumerator:
DEFINED 
QUEUED 
RUNNING 
FINISHED 

Member Function Documentation

boost::shared_ptr< LAMAThreadTask > lama::LAMAThreadTask::create ( boost::function< void()>  work,
unsigned int  taskId,
int  numOmpThreads = 0 
) [static]

Create a new task as a shared pointer.

References DEFINED.

Referenced by lama::LAMAThreadPool::schedule().


Field Documentation

true if task got an exception

current state of the task

unique task id

boost::function<void()> lama::LAMAThreadTask::mWork

task function to be executed

number of OpenMP threads to be used


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