golib  0.5
goThread Class Reference

#include <gothread.h>

Public Member Functions

void create (void *(*function)(void *), void *param, int howMany)
 Creates {\tt howMany} threads of {\function} with parameter {\tt param}.
 
void join ()
 Joins threads (blocks caller).
 
void suspend ()
 
void resume ()
 
void kill ()
 
void cancel ()
 
int makeInt ()
 
void resetInt ()
 Resets the ints made by {\tt makeInt()} to zero.
 
void getIndexRange (int threadNumber, int N, int &myStart, int &myEnd)
 
int getNumOfThreads ()
 
bool isCurrentThread (int threadNumber=0) const
 

Static Public Member Functions

static int howManyProcessors ()
 
static void checkCancel ()
 
static void setCancelType (int t)
 

Protected Attributes

void * threadFunction
 
void * threadParam
 
pthread_attr_t threadAttr
 
pthread_t * threads
 
int numberOfThreads
 
goMutex intMutex
 
int intCount
 

Detailed Description

Convenient frontend to the pthread standard.

Author
Christian Gosch

Member Function Documentation

◆ howManyProcessors()

static int goThread::howManyProcessors ( )
static
Returns
Number of processors online in this host.

◆ makeInt()

int goThread::makeInt ( )
Returns
A unique integer, starting with 0. This can be used to determine a thread ID.

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