melib: drop MutexGuard before calling add_path_to_index
In some cases add_path_to_index was called with the mutex already held, and a deadlock occurred.embed
parent
d231865f88
commit
13fba8d35b
|
@ -229,6 +229,11 @@ impl MailBackend for MaildirType {
|
|||
} else {
|
||||
/* Did we just miss a Create event? In any case, create
|
||||
* envelope. */
|
||||
|
||||
/* Drop the lock manually as add_path_to_index would deadlock
|
||||
* */
|
||||
drop(index_lock);
|
||||
drop(hash_indexes_lock);
|
||||
if let Some(env) = add_path_to_index(
|
||||
&hash_indexes,
|
||||
folder_hash,
|
||||
|
@ -311,6 +316,10 @@ impl MailBackend for MaildirType {
|
|||
.unwrap()
|
||||
.to_path_buf();
|
||||
debug!("filename = {:?}", file_name);
|
||||
/* Drop the lock manually as add_path_to_index would deadlock
|
||||
* */
|
||||
drop(index_lock);
|
||||
drop(hash_indexes_lock);
|
||||
if let Some(env) = add_path_to_index(
|
||||
&hash_indexes,
|
||||
folder_hash,
|
||||
|
|
Loading…
Reference in New Issue