24 #define usleep(A) Sleep(A/1000)
37 go(funcPtr,stack,stackSize);
40 void ThreadPT::go(ThreadJob funcPtr,
void *stack,
size_t stackSize)
43 void **stackT=(
void **) stack;
45 pthread_attr_init(&attr);
48 err = pthread_attr_setstacksize(&attr, stackSize);
49 if (err != 0)
throw Exception(
"Error when setting thread stack size");
51 err = pthread_create(&
_threadId, &attr, funcPtr, stackT);
52 pthread_attr_destroy(&attr);
53 if(err!=0)
throw Exception(
"Error in thread creation");
64 pthread_detach(pthread_self());
static void sleep(unsigned long usec)
static void exit(void *what)
void go(ThreadJob funcPtr, void *stack, size_t stackSize=0)
bool operator==(const ThreadPT &other)
static void detach()
Detach thread to release resources on exit.