git-svn-id: svn://db.shs.com.ru/pip@215 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2016-08-01 09:17:13 +00:00
parent 4bd01d7d41
commit 35f1923ca9
2 changed files with 7 additions and 2 deletions

View File

@@ -133,7 +133,11 @@ bool PIThread::start(int timer_delay) {
//piCout << "pthread_create" << thread; //piCout << "pthread_create" << thread;
pthread_attr_destroy(&attr); pthread_attr_destroy(&attr);
if (ret == 0) { if (ret == 0) {
# ifdef MAC_OS
pthread_threadid_np(thread, &tid)
# else
tid_ = thread; tid_ = thread;
# endif
#else #else
if (thread != 0) CloseHandle(thread); if (thread != 0) CloseHandle(thread);
thread = (void *)_beginthreadex(0, 0, thread_function, this, 0, 0); thread = (void *)_beginthreadex(0, 0, thread_function, this, 0, 0);

View File

@@ -105,7 +105,7 @@ public:
PIMutex & mutex() {return mutex_;} PIMutex & mutex() {return mutex_;}
//! \brief Returns thread ID //! \brief Returns thread ID
int tid() const {return tid_;} llong tid() const {return tid_;}
EVENT(started) EVENT(started)
EVENT(stopped) EVENT(stopped)
@@ -200,7 +200,8 @@ protected:
virtual void end() {;} virtual void end() {;}
volatile bool terminating, running_, lockRun; volatile bool terminating, running_, lockRun;
int delay_, policy_, tid_; int delay_, policy_;
llong tid_;
void * data_; void * data_;
PIMutex mutex_; PIMutex mutex_;
PITimeMeasurer tmf_, tms_, tmr_; PITimeMeasurer tmf_, tms_, tmr_;