From 3fbc3a3ff260688886a71a168f72ac70c30de24e Mon Sep 17 00:00:00 2001 From: Andrew Whitehead Date: Fri, 30 Jun 2023 16:48:52 -0700 Subject: [PATCH] (sqlite) do not drop notify mutex until after condvar is triggered (#2573) Signed-off-by: Andrew Whitehead --- sqlx-sqlite/src/statement/unlock_notify.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sqlx-sqlite/src/statement/unlock_notify.rs b/sqlx-sqlite/src/statement/unlock_notify.rs index ef755b6ac0..b7e723a3f3 100644 --- a/sqlx-sqlite/src/statement/unlock_notify.rs +++ b/sqlx-sqlite/src/statement/unlock_notify.rs @@ -57,7 +57,8 @@ impl Notify { } fn fire(&self) { - *self.mutex.lock().unwrap() = true; + let mut lock = self.mutex.lock().unwrap(); + *lock = true; self.condvar.notify_one(); } }