remove msleep, clean PIConditionVariable, rewrite pipipelinethread, etc...
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -469,13 +469,3 @@ PICout operator <<(PICout s, const PIDateTime & v) {
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
#ifdef WINDOWS
|
||||
void msleep(int msecs) {Sleep(msecs);}
|
||||
#else
|
||||
# ifdef FREERTOS
|
||||
void msleep(int msecs) {vTaskDelay(msecs / portTICK_PERIOD_MS);}
|
||||
# else
|
||||
void msleep(int msecs) {usleep(msecs * 1000);}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
#ifdef QNX
|
||||
# include <time.h>
|
||||
#endif
|
||||
//! @brief Sleep for "msecs" milliseconds
|
||||
PIP_EXPORT void msleep(int msecs);
|
||||
|
||||
/*! @brief Precise sleep for "usecs" microseconds
|
||||
* \details This function consider \c "usleep" offset
|
||||
|
||||
Reference in New Issue
Block a user