PIThread more accurate end, PIEthernet tcpserver client no reinit
This commit is contained in:
@@ -919,6 +919,10 @@ void PIThread::_runThread() {
|
||||
|
||||
|
||||
void PIThread::_endThread() {
|
||||
PIScopeExitCall ec([this] {
|
||||
terminating = running_ = false;
|
||||
tid_ = -1;
|
||||
});
|
||||
// PICout(PICoutManipulators::DefaultControls) << "thread" << this << "stop" << "...";
|
||||
stopped();
|
||||
// PICout(PICoutManipulators::DefaultControls) << "thread" << this << "stop" << "ok";
|
||||
@@ -927,8 +931,6 @@ void PIThread::_endThread() {
|
||||
end();
|
||||
// PICout(PICoutManipulators::DefaultControls) << "thread" << this << "stop" << "ok";
|
||||
if (lockRun) thread_mutex.unlock();
|
||||
terminating = running_ = false;
|
||||
tid_ = -1;
|
||||
// PICout(PICoutManipulators::DefaultControls) << "thread" << this << "exit";
|
||||
// cout << "thread " << t << " exiting ... " << endl;
|
||||
// PICout(PICoutManipulators::DefaultControls) << "pthread_exit" << (__privateinitializer__.p)->thread;
|
||||
@@ -943,7 +945,7 @@ void PIThread::_endThread() {
|
||||
#elif defined(FREERTOS)
|
||||
PRIVATE->thread = 0;
|
||||
#else
|
||||
pthread_detach(PRIVATE->thread);
|
||||
// pthread_detach(PRIVATE->thread);
|
||||
PRIVATE->thread = 0;
|
||||
pthread_exit(0);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user