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.
This commit is contained in:
Colin Walters committed 2015-05-10 16:20:53 -04:00
1 parent d0edf63346
commit 2dfe24632a
7 files changed
+185 -2

No files matched your search

+3
View File
@@ -368,6 +368,9 @@ ostree_sysroot_new_default
ostree_sysroot_get_path
ostree_sysroot_load
ostree_sysroot_lock
ostree_sysroot_try_lock
ostree_sysroot_lock_async
ostree_sysroot_lock_finish
ostree_sysroot_unlock
ostree_sysroot_get_fd
ostree_sysroot_ensure_initialized