diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-11-28 20:54:20 -0500 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-12-07 07:40:27 -0800 |
| commit | 755dcb223e9ca2aecd2555a417247d8f55fdaf33 (patch) | |
| tree | d655c43584285446e38c90536ed4b0b4b31c15a5 /src/core/sockimpl.h | |
| parent | 513f9d1b15257fdffa630e3a3d3fe85855343e41 (diff) | |
| download | nng-755dcb223e9ca2aecd2555a417247d8f55fdaf33.tar.gz nng-755dcb223e9ca2aecd2555a417247d8f55fdaf33.tar.bz2 nng-755dcb223e9ca2aecd2555a417247d8f55fdaf33.zip | |
fixes #1408 Reference count as a first class type
This starts by using this for the nni_pipe, but we will use it
for the other primary objects as well. This should simplify
the tear down and hopefully eliminate some races.
It does mean that pipe destruction goes through an additional
context switch, for now at least. This shouldn't be on the hot
data path anyway.
Diffstat (limited to 'src/core/sockimpl.h')
| -rw-r--r-- | src/core/sockimpl.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/core/sockimpl.h b/src/core/sockimpl.h index 45135976..801ef7b1 100644 --- a/src/core/sockimpl.h +++ b/src/core/sockimpl.h @@ -105,9 +105,8 @@ struct nni_pipe { nni_atomic_bool p_closed; nni_atomic_flag p_stop; bool p_cbs; - int p_ref; - nni_cv p_cv; nni_reap_node p_reap; + nni_refcnt p_refcnt; #ifdef NNG_ENABLE_STATS nni_stat_item st_root; |
