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

@@ -254,7 +254,7 @@ void PIIODevice::write_func() {
int ret = write(item.first);
threadedWriteEvent(item.second, ret);
}
msleep(PIP_MIN_MSLEEP);
piMSleep(PIP_MIN_MSLEEP);
}
}
@@ -338,7 +338,7 @@ PIByteArray PIIODevice::readForTime(double timeout_ms) {
tm.reset();
while (tm.elapsed_m() < timeout_ms) {
ret = read(td, threaded_read_buffer_size);
if (ret <= 0) msleep(PIP_MIN_MSLEEP);
if (ret <= 0) piMSleep(PIP_MIN_MSLEEP);
else str.append(td, ret);
}
delete[] td;