1 #include "ThreadPT.hxx"
2 #include "Exception.hxx"
5 using namespace YACS::BASES;
7 ThreadPT::ThreadPT(ThreadJob funcPtr, void *stack)
10 void **stackT=(void **) stack;
11 err=pthread_create(&_threadId,0,funcPtr,stackT);
12 if(err!=0)throw Exception("Error in thread creation");
15 bool ThreadPT::operator==(const ThreadPT& other)
17 return pthread_equal(_threadId, other._threadId) != 0;
20 //! Detach thread to release resources on exit
21 void ThreadPT::detach()
23 pthread_detach(pthread_self());
26 void ThreadPT::exit(void *what)
34 pthread_join(_threadId, &ret);
37 void ThreadPT::sleep(unsigned long usec)