diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/pipe.c | 6 | ||||
| -rw-r--r-- | src/core/pipe.h | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/core/pipe.c b/src/core/pipe.c index 5ce85420..94520c39 100644 --- a/src/core/pipe.c +++ b/src/core/pipe.c @@ -99,6 +99,12 @@ nni_pipe_rele(nni_pipe *p) nni_refcnt_rele(&p->p_refcnt); } +void +nni_pipe_hold(nni_pipe *p) +{ + nni_refcnt_hold(&p->p_refcnt); +} + // nni_pipe_id returns the 32-bit pipe id, which can be used in backtraces. uint32_t nni_pipe_id(nni_pipe *p) diff --git a/src/core/pipe.h b/src/core/pipe.h index aa7a0598..fc7b7a1a 100644 --- a/src/core/pipe.h +++ b/src/core/pipe.h @@ -55,6 +55,10 @@ extern uint32_t nni_pipe_dialer_id(nni_pipe *); // nni_pipe_rele releases the hold on the pipe placed by nni_pipe_find. extern void nni_pipe_rele(nni_pipe *); +// nni_pipe_hold adds an additional hold on the pipe. Each hold must be +// matched by a call to nni_pipe_rele. +extern void nni_pipe_hold(nni_pipe *); + // nni_pipe_add_stat adds a statistic to the pipe extern void nni_pipe_add_stat(nni_pipe *, nni_stat_item *); |
