git-svn-id: svn://db.shs.com.ru/pip@189 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -139,7 +139,6 @@ bool PIThread::start(int timer_delay) {
|
||||
thread = (void *)_beginthreadex(0, 0, thread_function, this, 0, 0);
|
||||
// thread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)thread_function, this, 0, 0);
|
||||
if (thread != 0) {
|
||||
tid_ = GetThreadId(thread);
|
||||
#endif
|
||||
setPriority(priority_);
|
||||
running_ = true;
|
||||
@@ -172,7 +171,6 @@ bool PIThread::startOnce() {
|
||||
thread = (void *)_beginthreadex(0, 0, thread_function_once, this, 0, 0);
|
||||
// thread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)thread_function_once, this, 0, 0);
|
||||
if (thread != 0) {
|
||||
tid_ = GetThreadId(thread);
|
||||
#endif
|
||||
setPriority(priority_);
|
||||
running_ = true;
|
||||
@@ -219,6 +217,9 @@ __THREAD_FUNC__ PIThread::thread_function(void * t) {
|
||||
__PISetTimerResolution();
|
||||
#endif
|
||||
PIThread & ct = *((PIThread * )t);
|
||||
#ifdef WINDOWS
|
||||
ct.tid_ = GetCurrentThreadId();
|
||||
#endif
|
||||
PIINTROSPECTION_REGISTER_THREAD(ct.tid(), ct.priority(), ct.name());
|
||||
ct.running_ = true;
|
||||
if (ct.lockRun) ct.mutex_.lock();
|
||||
@@ -276,6 +277,9 @@ __THREAD_FUNC__ PIThread::thread_function_once(void * t) {
|
||||
__PISetTimerResolution();
|
||||
#endif
|
||||
PIThread & ct = *((PIThread * )t);
|
||||
#ifdef WINDOWS
|
||||
ct.tid_ = GetCurrentThreadId();
|
||||
#endif
|
||||
PIINTROSPECTION_REGISTER_THREAD(ct.tid(), ct.priority(), ct.name());
|
||||
ct.running_ = true;
|
||||
ct.begin();
|
||||
|
||||
Reference in New Issue
Block a user