virtcontainers: store: Add a ItemLock API

The ItemLock API allows for taking shared and exclusive locks on all
items.
For virtcontainers, this is specialized into taking locks on the Lock
item, and will be used for sandbox locking.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz
2019-01-09 14:10:32 +01:00
parent 6e9256f483
commit 2ecffda170
5 changed files with 125 additions and 0 deletions

View File

@@ -53,4 +53,6 @@ type backend interface {
// The caller gets an item URL back and handles it directly,
// outside of the top level Store API.
raw(id string) (string, error)
lock(item Item, exclusive bool) (string, error)
unlock(item Item, token string) error
}