From 55f521b355d2ae25f50d26c82ca6aa3fced80063 Mon Sep 17 00:00:00 2001 From: Hristo Venev Date: Sun, 14 Apr 2024 17:37:48 +0300 Subject: Keep the lock in `bak_work` We have it at the start, keep it at the end. --- pgbak.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pgbak.c b/pgbak.c index 876fff9..3fed5eb 100644 --- a/pgbak.c +++ b/pgbak.c @@ -391,9 +391,9 @@ static void bak_work(int state) { state = STATE_SNAPSHOT; } lck_write(state); - lck_release(LOCK_STATE); - + if(state == STATE_IDLE) break; + lck_release(LOCK_STATE); if(state == STATE_SNAPSHOT || refresh_ts) { refresh_ts = false; -- cgit