This commit is contained in:
2022-11-10 15:03:51 +03:00
parent 4994d0bf66
commit e9a7eaa276
2 changed files with 8 additions and 5 deletions

View File

@@ -279,7 +279,7 @@ bool _PITimerImp_Thread::startTimer(double interval_ms) {
bool _PITimerImp_Thread::stopTimer(bool wait) {
thread_.stop();
event.notifyAll();
if (wait) return thread_.waitForFinish();
thread_.waitForFinish();
// if (wait)
// if (!thread_.waitForFinish(10))
// if (thread_.isRunning())
@@ -368,9 +368,12 @@ void _PITimerImp_Thread::adjustTimes() {
bool _PITimerImp_Thread::smallWait(int ms) {
thread_.mutex().lock();
event.waitFor(thread_.mutex(), ms);
thread_.mutex().unlock();
if (thread_.isStopping()) return false;
if (ms > 0) {
thread_.mutex().lock();
event.waitFor(thread_.mutex(), ms);
thread_.mutex().unlock();
}
return !thread_.isStopping();
}

View File

@@ -41,7 +41,6 @@ void Daemon::Remote::shellClose() {
if (!term) return;
piCoutObj << "shell close";
term_timer.stop();
term_timer.waitForFinish(1000);
term->destroy();
delete term;
term = 0;
@@ -331,6 +330,7 @@ Daemon::~Daemon() {
delete r;
}
remotes.clear();
delete _self;
}