Replace a sleep() with an MPSC channel
This commit is contained in:
@@ -122,11 +122,17 @@ impl telepathy::Connection for Connection {
|
||||
|
||||
fn disconnect(&self) -> Result<(), MethodErr> {
|
||||
println!("Connection<{}>::disconnect()", self.id);
|
||||
let ctx = self.ctx.read().unwrap();
|
||||
|
||||
let state = self.state.clone();
|
||||
let mut w = state.write().unwrap();
|
||||
*w = ConnState::Disconnected;
|
||||
|
||||
dc::job::interrupt_inbox_idle(&ctx);
|
||||
dc::job::interrupt_smtp_idle(&ctx);
|
||||
dc::job::interrupt_sentbox_idle(&ctx);
|
||||
dc::job::interrupt_mvbox_idle(&ctx);
|
||||
|
||||
// FIXME: we need to signal to the CM that they should remove the
|
||||
// connection from the active list
|
||||
|
||||
|
Reference in New Issue
Block a user