Fix compilation with sys_stat feature
This commit is contained in:
+3
-3
@@ -160,7 +160,7 @@ pub fn add_context_switch() {
|
||||
|
||||
/// Get the number of context switches.
|
||||
#[cfg(feature = "sys_stat")]
|
||||
pub fn get_context_switch_count() -> u64 {
|
||||
pub fn get_context_switch_count() -> usize {
|
||||
CONTEXT_SWITCH_COUNT.load(Ordering::Relaxed)
|
||||
}
|
||||
|
||||
@@ -176,13 +176,13 @@ pub fn add_context() {
|
||||
|
||||
/// Get the number of contexts created.
|
||||
#[cfg(feature = "sys_stat")]
|
||||
pub fn get_contexts_count() -> u64 {
|
||||
pub fn get_contexts_count() -> usize {
|
||||
CONTEXTS_COUNT.load(Ordering::Relaxed)
|
||||
}
|
||||
|
||||
/// Get the count of each interrupt.
|
||||
#[cfg(feature = "sys_stat")]
|
||||
pub fn irq_counts() -> Vec<u64> {
|
||||
pub fn irq_counts() -> Vec<usize> {
|
||||
IRQ_COUNT
|
||||
.iter()
|
||||
.map(|count| count.load(Ordering::Relaxed))
|
||||
|
||||
@@ -73,10 +73,12 @@ fn get_contexts_stats(token: &mut CleanLockToken) -> (u64, u64) {
|
||||
let mut running = 0;
|
||||
let mut blocked = 0;
|
||||
|
||||
let statuses = contexts(token.token())
|
||||
let mut contexts = contexts(token.token());
|
||||
let (contexts, mut token) = contexts.token_split();
|
||||
let statuses = contexts
|
||||
.iter()
|
||||
.filter_map(ContextRef::upgrade)
|
||||
.map(|context| context.read_arc().status.clone())
|
||||
.map(|context| context.read(token.token()).status.clone())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
for status in statuses {
|
||||
|
||||
Reference in New Issue
Block a user