Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

vuThread Class Reference

class providing basic multithreading functions More...

#include <vuThread.h>

Inheritance diagram for vuThread:

Inheritance graph
[legend]
Collaboration diagram for vuThread:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~vuThread ()
 Virtual destructor (doing nothing).
bool startThread (int whatsup, void *data=NULL)
 This function is called by the user to start a new thread.
virtual void run (int whatsup, void *data)=0
 This function is called when a new thread is started by startThread.
void stopThread ()

Private Attributes

vuMutex m_WhatsupMutex
 This is needed to avoid confusion in whatsup argument handling.
int m_Whatsup
 holds the argument passed to the thread started
void * m_AdditionalData
 holds the additional data passed to the thread started

Friends

void * _kickoff (void *ptr)

Detailed Description

class providing basic multithreading functions

NB - These threads are created as detached threads so that they will deallocate properely as the vuThread class is currently used.

Definition at line 99 of file vuThread.h.


Constructor & Destructor Documentation

virtual vuThread::~vuThread  )  [inline, virtual]
 

Virtual destructor (doing nothing).

Definition at line 103 of file vuThread.h.


Member Function Documentation

virtual void vuThread::run int  whatsup,
void *  data
[pure virtual]
 

This function is called when a new thread is started by startThread.

The function is virtual. Override it to run your own code. The whatsup argument is for free use to customize behaviour of different threads.

Implemented in vu1512112, vu1112117, vu1112113, ns_vu1112112::vu1112112, vuKeyFramerDialog, and vuKFThread.

Referenced by _kickoff().

bool vuThread::startThread int  whatsup,
void *  data = NULL
 

This function is called by the user to start a new thread.

It calls the virtual run() with parameter whatsup to allow different behaviour of the threads.

Definition at line 44 of file vuThread.cpp.

References _kickoff, vuMutex::lock(), m_AdditionalData, m_Whatsup, m_WhatsupMutex, and NULL.

Referenced by vu1112117::computeSlicesUsingThreads(), vu1112117::refineSlicesUsingThreads(), ns_vu1112112::vu1112112::render(), vu1512112::render(), and vu1112113::render().

Here is the call graph for this function:

void vuThread::stopThread  ) 
 

Definition at line 106 of file vuThread.cpp.

References NULL.

Referenced by _kickoff().


Friends And Related Function Documentation

void* _kickoff void *  ptr  )  [friend]
 

Definition at line 19 of file vuThread.cpp.

Referenced by startThread().


Member Data Documentation

void* vuThread::m_AdditionalData [private]
 

holds the additional data passed to the thread started

Definition at line 140 of file vuThread.h.

Referenced by _kickoff(), and startThread().

int vuThread::m_Whatsup [private]
 

holds the argument passed to the thread started

Definition at line 138 of file vuThread.h.

Referenced by _kickoff(), and startThread().

vuMutex vuThread::m_WhatsupMutex [private]
 

This is needed to avoid confusion in whatsup argument handling.

This solution is not elegant, but if we want to hand over an argument to run() we need it. Maybe someone has a better idea...

Definition at line 135 of file vuThread.h.

Referenced by _kickoff(), and startThread().


The documentation for this class was generated from the following files:
Generated on Wed Dec 15 21:22:07 2004 for vuVolume by  doxygen 1.3.9.1