From 8135cbf74697b1ad9f89b134e3583088e99ecbe4 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 22 Jun 2025 07:17:38 -0700 Subject: Hold the pipe across for the DTLS rx cb. --- src/core/pipe.c | 6 ++++++ src/core/pipe.h | 4 ++++ 2 files changed, 10 insertions(+) (limited to 'src/core') 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 *); -- cgit v1.2.3-70-g09d2