mirror of
https://github.com/chatmail/core.git
synced 2026-04-27 18:36:30 +03:00
wip: stop sharing the inbox across threads
This commit is contained in:
@@ -49,13 +49,15 @@ fn main() {
|
||||
let ctx1 = ctx.clone();
|
||||
let r1 = running.clone();
|
||||
let t1 = thread::spawn(move || {
|
||||
let mut inbox = ctx1.create_inbox();
|
||||
|
||||
while *r1.read().unwrap() {
|
||||
perform_imap_jobs(&ctx1);
|
||||
perform_imap_jobs(&ctx1, &mut inbox);
|
||||
if *r1.read().unwrap() {
|
||||
perform_imap_fetch(&ctx1);
|
||||
perform_imap_fetch(&ctx1, &mut inbox);
|
||||
|
||||
if *r1.read().unwrap() {
|
||||
perform_imap_idle(&ctx1);
|
||||
perform_imap_idle(&ctx1, &mut inbox);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,7 +115,7 @@ fn main() {
|
||||
println!("stopping threads");
|
||||
|
||||
*running.clone().write().unwrap() = false;
|
||||
deltachat::job::interrupt_imap_idle(&ctx);
|
||||
// not needed anymore I believe. deltachat::job::interrupt_imap_idle(&ctx);
|
||||
deltachat::job::interrupt_smtp_idle(&ctx);
|
||||
|
||||
println!("joining");
|
||||
|
||||
Reference in New Issue
Block a user