chore: using write lock to fix acquire lock error (#5938)

This commit is contained in:
Nathan.fooo 2024-08-12 16:28:34 +08:00 committed by GitHub
parent 7e53b34484
commit 1db8480b75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -373,7 +373,7 @@ impl FolderManager {
F1: FnOnce() -> Output, F1: FnOnce() -> Output,
F2: FnOnce(&Folder) -> Output, F2: FnOnce(&Folder) -> Output,
{ {
let folder = self.mutex_folder.read(); let folder = self.mutex_folder.write();
match &*folder { match &*folder {
None => none_callback(), None => none_callback(),
Some(folder) => f2(folder), Some(folder) => f2(folder),