Revert "replace try_lock() with lock_blocking() across UI thread"

This reverts commit 4225294d16.
This commit is contained in:
Kent Overstreet 2026-04-25 17:15:53 -04:00
commit 09896cd38b
28 changed files with 67 additions and 4199 deletions

View file

@ -59,7 +59,7 @@ const ACTIVITY_LINGER: std::time::Duration = std::time::Duration::from_secs(5);
impl Drop for ActivityGuard {
fn drop(&mut self) {
{ let mut st = self.agent.state.lock_blocking();
if let Ok(mut st) = self.agent.state.try_lock() {
if let Some(entry) = st.activities.iter_mut().find(|a| a.id == self.id) {
entry.label.push_str(" (complete)");
entry.expires_at = std::time::Instant::now() + ACTIVITY_LINGER;

View file

@ -152,7 +152,7 @@ async fn ensure_init(agent: Option<&std::sync::Arc<super::super::Agent>>) -> Res
let msg = format!("MCP server {} failed: {:#}", cfg.name, e);
dbglog!("{}", msg);
if let Some(a) = agent {
{ let mut st = a.state.lock_blocking();
if let Ok(mut st) = a.state.try_lock() {
st.notify(msg);
}
}