fix(imap): properly disconnect

This commit is contained in:
dignifiedquire
2019-05-12 23:12:38 +02:00
parent 693474d5be
commit 173d7cd767
3 changed files with 80 additions and 134 deletions

View File

@@ -59,11 +59,11 @@ pub unsafe fn dc_jobthread_suspend(
);
{
jobthread.state.clone().0.lock().unwrap().suspended = 1;
jobthread.state.0.lock().unwrap().suspended = 1;
}
dc_jobthread_interrupt_idle(context, jobthread);
loop {
let using_handle = jobthread.state.clone().0.lock().unwrap().using_handle;
let using_handle = jobthread.state.0.lock().unwrap().using_handle;
if using_handle == 0 {
return;
}
@@ -88,7 +88,7 @@ pub unsafe fn dc_jobthread_suspend(
pub unsafe fn dc_jobthread_interrupt_idle(context: &dc_context_t, jobthread: &dc_jobthread_t) {
{
jobthread.state.clone().0.lock().unwrap().jobs_needed = 1;
jobthread.state.0.lock().unwrap().jobs_needed = 1;
}
dc_log_info(
@@ -98,7 +98,6 @@ pub unsafe fn dc_jobthread_interrupt_idle(context: &dc_context_t, jobthread: &dc
jobthread.name,
);
println!("jobthread interrupt, waiting for lock");
jobthread.imap.interrupt_idle();
let &(ref lock, ref cvar) = &*jobthread.state.clone();
@@ -157,7 +156,7 @@ pub unsafe fn dc_jobthread_fetch(
}
}
jobthread.state.clone().0.lock().unwrap().using_handle = 0;
jobthread.state.0.lock().unwrap().using_handle = 0;
}
/* ******************************************************************************
@@ -258,5 +257,5 @@ pub unsafe fn dc_jobthread_idle(
jobthread.name,
);
jobthread.state.clone().0.lock().unwrap().using_handle = 0;
jobthread.state.0.lock().unwrap().using_handle = 0;
}