lib/repo: Add locking auto cleanup handler

Define an auto cleanup handler for use with repo locking. This is based
on the existing auto transaction cleanup. A wrapper for
ostree_repo_lock_push() is added with it. The intended usage is like so:

  g_autoptr(OstreeRepoAutoLock) lock = NULL;
  lock = ostree_repo_auto_lock_push (repo, lock_type, cancellable, error);
  if (!lock)
    return FALSE;

The functions and type are marked to be skipped by introspection since I
can't see them being usable from bindings.

Closes: #1343
Approved by: cgwalters
This commit is contained in:
Dan Nicholson authored and Atomic Bot committed 2017-12-05 02:32:47 +00:00
1 parent 4e78ddd2da
commit 7d863ed9e4
6 files changed
+93

No files matched your search

+3
View File
@@ -93,6 +93,9 @@ ostree_repo_finder_override_get_type
OstreeRepoLockType
ostree_repo_lock_push
ostree_repo_lock_pop
OstreeRepoAutoLock
ostree_repo_auto_lock_push
ostree_repo_auto_lock_cleanup
ostree_repo_get_collection_id
ostree_repo_set_collection_id
ostree_validate_collection_id