All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UT_TaskState Class Reference

#include <UT_TaskState.h>

Public Types

enum  TaskStatus { FREE, BUSY, DONE }

Public Member Functions

 UT_TaskState ()
void reset ()
bool isDone () const
 Test whether the task state is marked as DONE. More...
TaskStatus tryMarkAsBusy ()
TaskStatus tryMarkAsBusyFromDone ()
void addWaitingTask (UT_Task &parent_task)
void markAsDone (UT_Task &parent_task)
void markAsDoneNoThread ()
 Non-threaded version of marking as done. More...
TaskStatus relaxedLoadStatus () const
 This does a fast (non-atomic) check of the status. More...

Detailed Description

Definition at line 37 of file UT_TaskState.h.

Member Enumeration Documentation


Thread has acquired responsibility to evaluate node.


Another thread is busy evaluating the node.

The node has been evaluated.

Definition at line 48 of file UT_TaskState.h.

Constructor & Destructor Documentation

UT_TaskState::UT_TaskState ( )

Definition at line 55 of file UT_TaskState.h.

Member Function Documentation

void UT_TaskState::addWaitingTask ( UT_Task parent_task)

Assuming that we're busy, add a waiting task to be spawned when we're free again. This is done a lock-free linked-list style.

Definition at line 103 of file UT_TaskState.h.

bool UT_TaskState::isDone ( ) const

Test whether the task state is marked as DONE.

Definition at line 70 of file UT_TaskState.h.

void UT_TaskState::markAsDone ( UT_Task parent_task)

Mark this node as being free. We walk through our waiting tasks and spawn them. Since the proxy tasks are just empty tasks, they will complete immediately and decrement the ref count of their parent task. If the ref count of the parent task goes down to 0, then it will then be runnable in the task scheduler.

Definition at line 137 of file UT_TaskState.h.

void UT_TaskState::markAsDoneNoThread ( )

Non-threaded version of marking as done.

Definition at line 156 of file UT_TaskState.h.

TaskStatus UT_TaskState::relaxedLoadStatus ( ) const

This does a fast (non-atomic) check of the status.

Definition at line 168 of file UT_TaskState.h.

void UT_TaskState::reset ( void  )

Set the state to be "free" with no waiting tasks. This cannot be called from within threaded code.

Definition at line 63 of file UT_TaskState.h.

TaskStatus UT_TaskState::tryMarkAsBusy ( )

Attempt to claim this node for the calling thread, returning the current status.

Definition at line 78 of file UT_TaskState.h.

TaskStatus UT_TaskState::tryMarkAsBusyFromDone ( )

Assuming that we're done, claim the node for the calling thread. Returns FREE if succeeded, BUSY if failed.

Definition at line 90 of file UT_TaskState.h.

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