aboutsummaryrefslogtreecommitdiff
path: root/pgbak.c
diff options
context:
space:
mode:
authorHristo Venev <hristo@venev.name>2024-04-14 17:37:48 +0300
committerHristo Venev <hristo@venev.name>2024-04-14 17:37:48 +0300
commit55f521b355d2ae25f50d26c82ca6aa3fced80063 (patch)
treed97e4c5992d0ff6f4b575af5d2f82f038db3cb4d /pgbak.c
parent01fabfa25f92424e35ecb4ae98e95a06aa2e278f (diff)
Keep the lock in `bak_work`
We have it at the start, keep it at the end.
Diffstat (limited to 'pgbak.c')
-rw-r--r--pgbak.c4
1 files 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;