]> SALOME platform Git repositories - modules/yacs.git/blob - src/bases/ThreadPT.cxx
Salome HOME
c32b30d4272a87c0c26d2d92bb71c4f7ba10e539
[modules/yacs.git] / src / bases / ThreadPT.cxx
1 #include "ThreadPT.hxx"
2 #include <unistd.h>
3
4 using namespace YACS::BASES;
5
6 ThreadPT::ThreadPT(ThreadJob funcPtr, void *stack)
7 {
8   void **stackT=(void **) stack;
9   pthread_create(&_threadId,0,funcPtr,stackT);
10 }
11
12 bool ThreadPT::operator==(const ThreadPT& other)
13 {
14   return pthread_equal(_threadId, other._threadId) != 0;
15 }
16
17 void ThreadPT::join()
18 {
19   void *ret;
20   pthread_join(_threadId, &ret);
21 }
22
23 void ThreadPT::sleep(unsigned long usec)
24 {
25   usleep(usec);
26 }