Image Component Library (ICL)
Classes | Functions
Support Functions for Multi-Threading

Classes

class  icl::utils::MultiThreader
 Utility class for parallelizing algorithms. More...
class  icl::utils::Mutex
 Mutex class of the ICL. More...
class  icl::utils::Semaphore
 Simple Semaphore implementation wrapping the standard linux "sem_t"-struct. More...
class  icl::utils::Thread
 Simple object oriented thread class wrapping the pthread library. More...

Functions

template<class T >
static void icl::utils::saveDelete (T *&pointer)
 static utility function which deletes a pointer and sets it to NULL
template<class T , void(T::*)() func>
static void icl::utils::saveCall (T *obj)
 static utility function which ensures Thread-safety for object functions

Function Documentation

template<class T , void(T::*)() func>
static void icl::utils::saveCall ( T *  obj) [inline, static]

static utility function which ensures Thread-safety for object functions

Internally this function template will create a specific mutex for the given class T and the given member function. When using the saveCall template to call an objects member-function from different threads, the function will automatically become Thread-save, as it is only executes once at one time.

template<class T >
static void icl::utils::saveDelete ( T *&  pointer) [inline, static]

static utility function which deletes a pointer and sets it to NULL

Internally this function template will create a specific mutex for the given class T. All calls to the saveDelete function are protected by the static mutex. So saveDelete(XXX) can be called from different threads [but with the identical pointer reference] without the risk of segmentation violations or double free exceptions.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines