mirror of
https://github.com/chatmail/core.git
synced 2026-05-01 20:36:31 +03:00
fix(imap): properly disconnect
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user