diff options
author | Colin Walters <walters@verbum.org> | 2015-05-06 22:19:05 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2015-05-10 16:20:53 -0400 |
commit | 2dfe24632a4d1d73ca5676b503135090f092db22 (patch) | |
tree | 596abfd7530e73a117eb159557443cd23052a002 /src/libostree/ostree-sysroot.h | |
parent | d0edf6334625d9f65917a1bfbe42076f52b0fe8f (diff) | |
download | ostree-2dfe24632a4d1d73ca5676b503135090f092db22.tar.gz |
sysroot: Add a try_lock() API
The blocking locking API wasn't sufficient for use in the rpm-ostree
daemon; it really wants to know if the lock is held, then continue to
do other things (like service DBus requests), and get notification
when the lock is available.
We also add an async variant that can be called if the lock is not
available.
Implement a higher level "loop until lock is available" method in the
`ostree admin` commandline.
Diffstat (limited to 'src/libostree/ostree-sysroot.h')
-rw-r--r-- | src/libostree/ostree-sysroot.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libostree/ostree-sysroot.h b/src/libostree/ostree-sysroot.h index e7f6e482..ce128bba 100644 --- a/src/libostree/ostree-sysroot.h +++ b/src/libostree/ostree-sysroot.h @@ -63,6 +63,16 @@ char *ostree_sysroot_get_deployment_dirpath (OstreeSysroot *self, GFile * ostree_sysroot_get_deployment_origin_path (GFile *deployment_path); gboolean ostree_sysroot_lock (OstreeSysroot *self, GError **error); +gboolean ostree_sysroot_try_lock (OstreeSysroot *self, + gboolean *out_acquired, + GError **error); +void ostree_sysroot_lock_async (OstreeSysroot *self, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean ostree_sysroot_lock_finish (OstreeSysroot *self, + GAsyncResult *result, + GError **error); void ostree_sysroot_unlock (OstreeSysroot *self); gboolean ostree_sysroot_cleanup (OstreeSysroot *self, |