lib/repo: Add MT support for transaction_set_ref(), clarify MT rules
authorColin Walters <walters@verbum.org>
Fri, 1 Dec 2017 20:18:37 +0000 (15:18 -0500)
committerAtomic Bot <atomic-devel@projectatomic.io>
Mon, 4 Dec 2017 19:16:21 +0000 (19:16 +0000)
commit89a57bb6d82afdccd07f7ff98b498c4a24bd4820
tree762f4096eac32659856c3ae31102144faf858415
parent8d6b30c3819e962324a2e836ed9b576215373195
lib/repo: Add MT support for transaction_set_ref(), clarify MT rules

For rpm-ostree I'd like to do importing in parallel with threads; the code is
*almost* ready for that except today it calls
`ostree_repo_transaction_set_ref()`.

Looking at the code, there's really a "transaction" struct here,
not just stats.  Let's lift that struct out, and move the refs
into it under the existing lock.

Clarify the documentation around multithreading for various functions.

Closes: #1358
Approved by: jlebon
src/libostree/ostree-repo-commit.c
src/libostree/ostree-repo-private.h
src/libostree/ostree-repo.c