diff options
author | Dan Nicholson <dbn@endlessos.org> | 2021-04-28 21:13:15 -0600 |
---|---|---|
committer | Dan Nicholson <dbn@endlessos.org> | 2021-06-05 09:07:39 -0600 |
commit | c3ada6fa7a1db488fced6acde5faaaf435e09aba (patch) | |
tree | 118332e42d3c47d1963ab9b26ff4f93d3242903f /src/libostree/ostree-repo-commit.c | |
parent | 0f36d8c2219decbb5794ff19b5259d15d3d8d791 (diff) | |
download | ostree-c3ada6fa7a1db488fced6acde5faaaf435e09aba.tar.gz |
repo: Require lock type in ostree_repo_lock_pop
This simplifies the lock state management considerably since the
previously pushed type doesn't need to be tracked. Instead, 2 counters
are kept to track how many times each lock type has been pushed. When
the number of exclusive locks drops to 0, the lock transitions back to
shared.
Diffstat (limited to 'src/libostree/ostree-repo-commit.c')
-rw-r--r-- | src/libostree/ostree-repo-commit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libostree/ostree-repo-commit.c b/src/libostree/ostree-repo-commit.c index dd5cd862..ffd8319f 100644 --- a/src/libostree/ostree-repo-commit.c +++ b/src/libostree/ostree-repo-commit.c @@ -2341,7 +2341,7 @@ ostree_repo_commit_transaction (OstreeRepo *self, if (self->txn_locked) { - if (!ostree_repo_lock_pop (self, cancellable, error)) + if (!ostree_repo_lock_pop (self, OSTREE_REPO_LOCK_SHARED, cancellable, error)) return FALSE; self->txn_locked = FALSE; } @@ -2399,7 +2399,7 @@ ostree_repo_abort_transaction (OstreeRepo *self, if (self->txn_locked) { - if (!ostree_repo_lock_pop (self, cancellable, error)) + if (!ostree_repo_lock_pop (self, OSTREE_REPO_LOCK_SHARED, cancellable, error)) return FALSE; self->txn_locked = FALSE; } |