mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-14 04:54:37 +03:00
Add ProcessList_isCPUonline
This commit is contained in:

committed by
Benny Baumann

parent
41af31be7f
commit
11d2206f40
@ -447,3 +447,16 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) {
|
||||
|
||||
OpenBSDProcessList_scanProcs(opl);
|
||||
}
|
||||
|
||||
bool ProcessList_isCPUonline(const ProcessList* super, unsigned int id) {
|
||||
assert(id < super->existingCPUs);
|
||||
|
||||
const OpenBSDProcessList* opl = (const OpenBSDProcessList*) super;
|
||||
|
||||
for (unsigned int i = 0; i < super->activeCPUs; i++) {
|
||||
if (opl->cpus[i].cpuIndex == id)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -55,4 +55,6 @@ void ProcessList_delete(ProcessList* this);
|
||||
|
||||
void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate);
|
||||
|
||||
bool ProcessList_isCPUonline(const ProcessList* super, unsigned int id);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user