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.
This commit is contained in:
1 parent
0f36d8c221
commit
c3ada6fa7a
4 files changed
+132
-71
No files matched your search
+3
-3
@@ -137,9 +137,9 @@ assertEquals(actual_checksum, networks_checksum)
|
||||
// Basic locking API sanity test
|
||||
repo.lock_push(OSTree.RepoLockType.SHARED, null);
|
||||
repo.lock_push(OSTree.RepoLockType.SHARED, null);
|
||||
repo.lock_pop(null);
|
||||
repo.lock_pop(null);
|
||||
repo.lock_pop(OSTree.RepoLockType.SHARED, null);
|
||||
repo.lock_pop(OSTree.RepoLockType.SHARED, null);
|
||||
repo.lock_push(OSTree.RepoLockType.EXCLUSIVE, null);
|
||||
repo.lock_pop(null);
|
||||
repo.lock_pop(OSTree.RepoLockType.EXCLUSIVE, null);
|
||||
|
||||
print("ok test-core");
|
||||
Reference in new issue
Block a user