remove msleep, clean PIConditionVariable, rewrite pipipelinethread, etc...
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user