35 #ifndef __igtlMultiThreader_h 36 #define __igtlMultiThreader_h 44 #ifdef OpenIGTLink_USE_SPROC 45 #include <sys/types.h> 49 #if defined(OpenIGTLink_USE_PTHREAD) || defined(OpenIGTLink_HP_PTHREAD) 51 #include <sys/types.h> 73 #ifdef OpenIGTLink_USE_SPROC 74 #define IGTL_MAX_THREADS 128 77 #ifdef OpenIGTLink_USE_PTHREADS 78 #define IGTL_MAX_THREADS 128 81 #ifdef OpenIGTLink_USE_WIN32_THREADS 82 #define IGTL_MAX_THREADS 128 87 #undef IGTL_MAX_THREADS 88 #define IGTL_MAX_THREADS 128 92 #if defined(__MINGW32__) 93 #undef IGTL_MAX_THREADS 94 #define IGTL_MAX_THREADS 1 98 #if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730 99 #undef IGTL_MAX_THREADS 100 #define IGTL_MAX_THREADS 1 103 #ifndef IGTL_MAX_THREADS 104 #define IGTL_MAX_THREADS 1 107 #ifdef OpenIGTLink_USE_SPROC 112 #ifdef OpenIGTLink_USE_PTHREADS 113 typedef void *(*ThreadFunctionType)(
void *);
118 #ifdef OpenIGTLink_USE_WIN32_THREADS 124 #if !defined(OpenIGTLink_USE_PTHREADS) && !defined(OpenIGTLink_USE_WIN32_THREADS) 125 typedef void (*ThreadFunctionType)(
void *);
157 #define ThreadInfoStruct MultiThreader::ThreadInfo 174 virtual int GetNumberOfThreads();
180 static void SetGlobalMaximumNumberOfThreads(
int val);
181 static int GetGlobalMaximumNumberOfThreads();
187 static void SetGlobalDefaultNumberOfThreads(
int val);
188 static int GetGlobalDefaultNumberOfThreads();
198 void SingleMethodExecute();
204 void MultipleMethodExecute();
212 void SetSingleMethod(ThreadFunctionType,
void *data );
217 void SetMultipleMethod(
int index, ThreadFunctionType,
void *data );
223 int SpawnThread( ThreadFunctionType,
void *data );
227 void TerminateThread(
int thread_id );
231 static MultiThreaderIDType GetCurrentThreadID();
235 static int ThreadsEqual(MultiThreaderIDType t1,
236 MultiThreaderIDType t2);
242 void PrintSelf(std::ostream& os)
const;
SmartPointer< const Self > ConstPointer
ThreadFunctionType m_SingleMethod
#define igtlTypeMacro(thisClass, superclass)
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...
#define igtlSetClampMacro(name, type, min, max)
void(* ThreadFunctionType)(void *)
MutexLock::Pointer ActiveFlagLock
SmartPointer< Self > Pointer
Base class for most igtl classes.