From ba0ea759b8eb5ebd75ea0ffb87307cabd7140b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=8B=D1=87=D0=BA=D0=BE=D0=B2=20=D0=90=D0=BD=D0=B4?= =?UTF-8?q?=D1=80=D0=B5=D0=B9?= Date: Thu, 7 Feb 2019 15:37:59 +0000 Subject: [PATCH] git-svn-id: svn://db.shs.com.ru/pip@718 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- src_main/thread/pithread.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src_main/thread/pithread.cpp b/src_main/thread/pithread.cpp index 6ce4e20a..a93f6065 100755 --- a/src_main/thread/pithread.cpp +++ b/src_main/thread/pithread.cpp @@ -190,8 +190,10 @@ PIThread::~PIThread() { #ifdef FREERTOS //void * ret(0); piCout << "~PIThread" << PRIVATE->thread; - piCout << pthread_join(PRIVATE->thread, 0); - piCout << "FREERTOS can't join pthreads!"; + //piCout << pthread_join(PRIVATE->thread, 0); + piCout << "FreeRTOS can't join pthreads! waiting for stop"; + stop(true); + piCout << "stopped!" #else #ifndef WINDOWS # ifdef ANDROID @@ -292,14 +294,16 @@ bool PIThread::startOnce() { void PIThread::terminate() { +#ifdef FREERTOS + piCout << "FreeRTOS can't terminate pthreads! waiting for stop"; + stop(true); + piCout << "stopped!" +#else if (PRIVATE->thread == 0) return; UNREGISTER_THREAD(this); PIINTROSPECTION_UNREGISTER_THREAD(tid()); terminating = running_ = false; tid_ = -1; -#ifdef FREERTOS - piCout << "FREERTOS can't terminate pthreads!"; -#endif //piCout << "terminate" << PRIVATE->thread; #ifndef WINDOWS # ifdef ANDROID @@ -316,6 +320,7 @@ void PIThread::terminate() { #endif PRIVATE->thread = 0; end(); +#endif }