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

This commit is contained in:
2019-02-06 21:28:16 +00:00
parent 1190c0449c
commit f09111b6a2
2 changed files with 13 additions and 2 deletions

View File

@@ -187,8 +187,11 @@ PIThread::PIThread(bool startNow, int timer_delay): PIObject() {
PIThread::~PIThread() {
piMonitor.threads--;
if (!running_ || PRIVATE->thread == 0) return;
#ifdef FREERTOS
piCout << "FREERTOS can't terminate pthreads!";
#endif
#ifndef WINDOWS
# if defined(ANDROID) || defined(FREERTOS)
# ifdef ANDROID
pthread_kill(PRIVATE->thread, SIGTERM);
# else
pthread_cancel(PRIVATE->thread);
@@ -287,9 +290,12 @@ void PIThread::terminate() {
PIINTROSPECTION_UNREGISTER_THREAD(tid());
terminating = running_ = false;
tid_ = -1;
#ifdef FREERTOS
piCout << "FREERTOS can't terminate pthreads!";
#endif
//piCout << "terminate" << PRIVATE->thread;
#ifndef WINDOWS
# if defined(ANDROID) || defined(FREERTOS)
# ifdef ANDROID
pthread_kill(PRIVATE->thread, SIGTERM);
# else
//pthread_kill(PRIVATE->thread, SIGKILL);

View File

@@ -442,7 +442,11 @@ bool _PITimerImp_Pool::stopTimer(bool wait) {
PITimer::PITimer(): PIObject() {
piMonitor.timers++;
#ifdef FREERTOS
imp_mode = PITimer::Pool;
#else
imp_mode = PITimer::Thread;
#endif
initFirst();
}
@@ -511,6 +515,7 @@ void PITimer::init() {
void PITimer::destroy() {
//piCout << "destroy" << this << imp;
if (imp == 0) return;
imp->stop(true);
delete imp;
imp = 0;
}