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

@@ -66,7 +66,7 @@ void PIProcess::exec_() {
startOnce();
//cout << "exec wait" << endl;
while (!is_exec)
msleep(PIP_MIN_MSLEEP);
piMSleep(PIP_MIN_MSLEEP);
//cout << "exec end" << endl;
}

View File

@@ -145,9 +145,9 @@ bool PISystemMonitor::startOnSelf(int interval_ms) {
PIVector<PISystemMonitor::ThreadStats> PISystemMonitor::threadsStatistic() const {
mutex_.lock();
lock();
PIVector<PISystemMonitor::ThreadStats> ret = cur_ts;
mutex_.unlock();
unlock();
return ret;
}
@@ -341,9 +341,9 @@ void PISystemMonitor::run() {
//piCout << ts_new.cpu_load_user;
}
last_tm = cur_tm;
mutex_.lock();
lock();
cur_ts = cur_tm.values();
mutex_.unlock();
unlock();
tstat.ram_total = totalRAM();
tstat.ram_used = usedRAM();
tstat.ram_free = freeRAM();