diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-06-22 07:17:38 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-06-22 07:17:38 -0700 |
| commit | 8135cbf74697b1ad9f89b134e3583088e99ecbe4 (patch) | |
| tree | b5daada2b7e9ebce20acdc08c2ad20ac65072706 /src/core | |
| parent | fb153297c987e47bde25faa113a191c16eab901a (diff) | |
| download | nng-8135cbf74697b1ad9f89b134e3583088e99ecbe4.tar.gz nng-8135cbf74697b1ad9f89b134e3583088e99ecbe4.tar.bz2 nng-8135cbf74697b1ad9f89b134e3583088e99ecbe4.zip | |
Hold the pipe across for the DTLS rx cb.
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 *); |
