mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-24 15:49:14 -04:00
MINOR: shctx: Add new reserve_finish callback call to shctx_row_reserve_hot
This patch adds a reserve_finish callback that can be defined by the subsystems that require a shared_context. It is called at the end of shctx_row_reserve_hot after the shared_context lock is released.
This commit is contained in:
parent
11df806c88
commit
1cd91b4f2a
2 changed files with 4 additions and 0 deletions
|
|
@ -51,6 +51,7 @@ struct shared_context {
|
|||
unsigned int nbav; /* number of available blocks */
|
||||
unsigned int max_obj_size; /* maximum object size (in bytes). */
|
||||
void (*free_block)(struct shared_block *first, struct shared_block *block, void *data);
|
||||
void (*reserve_finish)(struct shared_context *shctx);
|
||||
void *cb_data;
|
||||
short int block_size;
|
||||
unsigned char data[VAR_ARRAY];
|
||||
|
|
|
|||
|
|
@ -110,6 +110,9 @@ struct shared_block *shctx_row_reserve_hot(struct shared_context *shctx,
|
|||
|
||||
shctx_wrunlock(shctx);
|
||||
|
||||
if (shctx->reserve_finish)
|
||||
shctx->reserve_finish(shctx);
|
||||
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue