remove msleep, clean PIConditionVariable, rewrite pipipelinethread, etc...

This commit is contained in:
Andrey
2021-10-29 16:52:03 +03:00
parent 21e03fc8cb
commit 6e5a5a6ade
16 changed files with 203 additions and 213 deletions

View File

@@ -708,7 +708,7 @@ PIObject::Deleter::Deleter() {
stopping = started = posted = false;
CONNECTL(&(PRIVATE->thread), started, [this](){proc();});
PRIVATE->thread.startOnce();
while (!started) piMSleep(1);
while (!started) piMSleep(PIP_MIN_MSLEEP);
}
@@ -717,7 +717,7 @@ PIObject::Deleter::~Deleter() {
stopping = true;
PRIVATE->cond_var.notifyAll();
#ifndef WINDOWS
while (PRIVATE->thread.isRunning()) piMSleep(1);
while (PRIVATE->thread.isRunning()) piMSleep(PIP_MIN_MSLEEP);
#endif
deleteAll();
//piCout << "~Deleter ok";
@@ -780,7 +780,7 @@ void PIObject::Deleter::deleteObject(PIObject * o) {
//piCout << "[Deleter] delete" << (uintptr_t)o << "...";
if (o->isPIObject()) {
//piCout << "[Deleter] delete" << (uintptr_t)o << "wait atomic ...";
while (o->isInEvent()) piMSleep(1);
while (o->isInEvent()) piMSleep(PIP_MIN_MSLEEP);
//piCout << "[Deleter] delete" << (uintptr_t)o << "wait atomic done";
if (o->isPIObject()) delete o;
}