diff options
author | Philip Withnall <withnall@endlessm.com> | 2017-04-28 16:18:55 +0100 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2017-04-29 11:50:15 +0000 |
commit | c27b66de80ee09077b770b8059a15e5c541e70e3 (patch) | |
tree | 65600640ea2a4f019bfac08ce6a744197b951c11 /apidoc | |
parent | f74e52a3a0c441f8e56b796d99c492b1a0a2072c (diff) | |
download | ostree-c27b66de80ee09077b770b8059a15e5c541e70e3.tar.gz |
libostree: Add multiple getter/setter support to OstreeAsyncProgress
OstreeAsyncProgress is thread-safe: it can have keys changed by one
thread while another is getting the same keys (modulo some locking
contention). However, the thread safety is done at the function call
level: if some code calls an OstreeAsyncProgress getter several times,
the key fetches are not atomic with respect to each other.
In the case of contention on the lock, this can result in consumers of
OstreeAsyncProgress data seeing an inconsistent state between the
properties they query, which could result in progress reporting
inaccuracies.
In the uncontested case, this results in the OstreeAsyncProgress lock
being locked and unlocked many times more than necessary.
Try to improve this by adding new API, which supports getting and
setting multiple keys atomically:
• ostree_async_progress_get()
• ostree_async_progress_set()
The new API uses GVariants and varargs: keys are passed as a
GVariantType string followed by arguments as for g_variant_new() or
g_variant_get(), followed by the next key, etc.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #819
Approved by: cgwalters
Diffstat (limited to 'apidoc')
-rw-r--r-- | apidoc/ostree-sections.txt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/apidoc/ostree-sections.txt b/apidoc/ostree-sections.txt index 5625a193..adc2dfd7 100644 --- a/apidoc/ostree-sections.txt +++ b/apidoc/ostree-sections.txt @@ -4,10 +4,12 @@ OstreeAsyncProgress ostree_async_progress_new ostree_async_progress_new_and_connect ostree_async_progress_get_status +ostree_async_progress_get ostree_async_progress_get_variant ostree_async_progress_get_uint ostree_async_progress_get_uint64 ostree_async_progress_set_status +ostree_async_progress_set ostree_async_progress_set_variant ostree_async_progress_set_uint ostree_async_progress_set_uint64 |