Merge "Keystore 2.0: Reduce sqlite cache to 0.5M"
diff --git a/keystore2/src/async_task.rs b/keystore2/src/async_task.rs
index 4d0034a..45f0274 100644
--- a/keystore2/src/async_task.rs
+++ b/keystore2/src/async_task.rs
@@ -19,6 +19,7 @@
//! processed all tasks before it terminates.
//! Note that low priority tasks are processed only when the high priority queue is empty.
+use crate::utils::watchdog as wd;
use std::{any::Any, any::TypeId, time::Duration};
use std::{
collections::{HashMap, VecDeque},
@@ -170,6 +171,7 @@
{
let (ref condvar, ref state) = *self.state;
let mut state = state.lock().unwrap();
+
if hi_prio {
state.hi_prio_req.push_back(Box::new(f));
} else {
@@ -239,11 +241,14 @@
// Now that the lock has been dropped, perform the action.
match action {
Action::QueuedFn(f) => {
+ let _wd = wd::watch_millis("async_task thread: calling queued fn", 500);
f(&mut shelf);
done_idle = false;
}
Action::IdleFns(idle_fns) => {
for idle_fn in idle_fns {
+ let _wd =
+ wd::watch_millis("async_task thread: calling idle_fn", 500);
idle_fn(&mut shelf);
}
done_idle = true;