diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-09-30 16:16:14 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-09-30 16:16:14 -0700 |
| commit | ab68c70a8b90626be24d95a27f6495ab6e7e57a5 (patch) | |
| tree | 72a3caa79d15bc26df1bc1b0259d3522db892bc2 /reftable/reftable-stack.h | |
| parent | 3857aae53f3633b7de63ad640737c657387ae0c6 (diff) | |
| parent | 6241ce217046cc77d306bda06ad80ac1973b4932 (diff) | |
| download | git-ab68c70a8b90626be24d95a27f6495ab6e7e57a5.tar.gz | |
Merge branch 'ps/reftable-concurrent-writes'
Give timeout to the locking code to write to reftable.
* ps/reftable-concurrent-writes:
refs/reftable: reload locked stack when preparing transaction
reftable/stack: allow locking of outdated stacks
refs/reftable: introduce "reftable.lockTimeout"
Diffstat (limited to 'reftable/reftable-stack.h')
| -rw-r--r-- | reftable/reftable-stack.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/reftable/reftable-stack.h b/reftable/reftable-stack.h index f4f8cabc7f..6370fe45dd 100644 --- a/reftable/reftable-stack.h +++ b/reftable/reftable-stack.h @@ -37,12 +37,21 @@ uint64_t reftable_stack_next_update_index(struct reftable_stack *st); /* holds a transaction to add tables at the top of a stack. */ struct reftable_addition; +enum { + /* + * Reload the stack when the stack is out-of-date after locking it. + */ + REFTABLE_STACK_NEW_ADDITION_RELOAD = (1 << 0), +}; + /* * returns a new transaction to add reftables to the given stack. As a side - * effect, the ref database is locked. + * effect, the ref database is locked. Accepts REFTABLE_STACK_NEW_ADDITION_* + * flags. */ int reftable_stack_new_addition(struct reftable_addition **dest, - struct reftable_stack *st); + struct reftable_stack *st, + unsigned int flags); /* Adds a reftable to transaction. */ int reftable_addition_add(struct reftable_addition *add, |
