mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 06:16:30 +03:00
add a comment, fix a typo in debug message
This commit is contained in:
@@ -657,7 +657,7 @@ pub unsafe extern "C" fn dc_get_next_event(events: *mut dc_event_emitter_t) -> *
|
|||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub unsafe extern "C" fn dc_stop_io(context: *mut dc_context_t) {
|
pub unsafe extern "C" fn dc_stop_io(context: *mut dc_context_t) {
|
||||||
if context.is_null() {
|
if context.is_null() {
|
||||||
eprintln!("ignoring careless call to dc_shutdown()");
|
eprintln!("ignoring careless call to dc_stop_io()");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let ctx = &*context;
|
let ctx = &*context;
|
||||||
|
|||||||
@@ -710,7 +710,7 @@ class Account(object):
|
|||||||
if self._event_thread.is_alive():
|
if self._event_thread.is_alive():
|
||||||
self.log("WARN: event thread did not terminate yet, ignoring.")
|
self.log("WARN: event thread did not terminate yet, ignoring.")
|
||||||
|
|
||||||
self.log("remove dc_context references, making the Account unusuable")
|
self.log("remove dc_context references, making the Account unusable")
|
||||||
self._dc_context = None
|
self._dc_context = None
|
||||||
|
|
||||||
self._shutdown_event.set()
|
self._shutdown_event.set()
|
||||||
|
|||||||
@@ -202,6 +202,11 @@ impl Context {
|
|||||||
|
|
||||||
/// Stops the IO scheduler.
|
/// Stops the IO scheduler.
|
||||||
pub async fn stop_io(&self) {
|
pub async fn stop_io(&self) {
|
||||||
|
// Sending an event wakes up event pollers (get_next_event)
|
||||||
|
// so the caller of stop_io() can arrange for proper termination.
|
||||||
|
// For this, the caller needs to instruct the event poller
|
||||||
|
// to terminate on receiving the next event and then call stop_io()
|
||||||
|
// which will emit the below event(s)
|
||||||
info!(self, "stopping IO");
|
info!(self, "stopping IO");
|
||||||
|
|
||||||
if let Err(err) = self.inner.stop_io().await {
|
if let Err(err) = self.inner.stop_io().await {
|
||||||
|
|||||||
Reference in New Issue
Block a user