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

This commit is contained in:
2016-03-01 16:16:23 +00:00
parent 2b7bf4a65e
commit 0d77d3b425
8 changed files with 303 additions and 7 deletions

View File

@@ -19,7 +19,7 @@
#include "pithread.h"
#include "pisystemtests.h"
#include "piintrospection.h"
#include "piintrospection_proxy.h"
#include <signal.h>
#ifdef WINDOWS
void __PISetTimerResolution() {if (setTimerResolutionAddr == NULL) return; ULONG ret; setTimerResolutionAddr(1, TRUE, &ret);}
@@ -187,7 +187,7 @@ bool PIThread::startOnce() {
void PIThread::terminate() {
if (thread == 0) return;
PIINTROSPECTION->unregisterThread(tid());
PIINTROSPECTION_UNREGISTER_THREAD(tid());
terminating = running_ = false;
tid_ = -1;
//piCout << "terminate" << thread;
@@ -219,7 +219,7 @@ __THREAD_FUNC__ PIThread::thread_function(void * t) {
__PISetTimerResolution();
#endif
PIThread & ct = *((PIThread * )t);
PIINTROSPECTION->registerThread(ct.tid(), ct.priority(), ct.name());
PIINTROSPECTION_REGISTER_THREAD(ct.tid(), ct.priority(), ct.name());
ct.running_ = true;
if (ct.lockRun) ct.mutex_.lock();
ct.begin();
@@ -251,7 +251,7 @@ __THREAD_FUNC__ PIThread::thread_function(void * t) {
ct.tid_ = -1;
//cout << "thread " << t << " exiting ... " << endl;
//piCout << "pthread_exit" << ct.thread;
PIINTROSPECTION->unregisterThread(ct.tid());
PIINTROSPECTION_UNREGISTER_THREAD(ct.tid());
#ifndef WINDOWS
pthread_detach(ct.thread);
ct.thread = 0;
@@ -276,7 +276,7 @@ __THREAD_FUNC__ PIThread::thread_function_once(void * t) {
__PISetTimerResolution();
#endif
PIThread & ct = *((PIThread * )t);
PIINTROSPECTION->registerThread(ct.tid(), ct.priority(), ct.name());
PIINTROSPECTION_REGISTER_THREAD(ct.tid(), ct.priority(), ct.name());
ct.running_ = true;
ct.begin();
ct.started();
@@ -290,7 +290,7 @@ __THREAD_FUNC__ PIThread::thread_function_once(void * t) {
ct.tid_ = -1;
//cout << "thread " << t << " exiting ... " << endl;
//piCout << "pthread_exit" << ct.thread;
PIINTROSPECTION->unregisterThread(ct.tid());
PIINTROSPECTION_UNREGISTER_THREAD(ct.tid());
#ifndef WINDOWS
pthread_detach(ct.thread);
ct.thread = 0;