Use sync RwLock for debug_logging

This avoids the need for potentially expensive block_in_place(),
but is unlikely to actually block the thread as holding write lock is rare.
This commit is contained in:
link2xt
2023-04-16 18:48:06 +00:00
parent 2b7ee85e30
commit 4716fcef94
5 changed files with 17 additions and 9 deletions

View File

@@ -1425,7 +1425,7 @@ pub async fn delete_msgs(context: &Context, msg_ids: &[MsgId]) -> Result<()> {
let logging_xdc_id = context
.debug_logging
.read()
.await
.expect("RwLock is poisoned")
.as_ref()
.map(|dl| dl.msg_id);