diff options
| author | Garrett D'Amore <garrett@damore.org> | 2021-12-27 23:10:29 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2021-12-27 23:10:29 -0800 |
| commit | 2fbfd7e5c3ad245de2c905720eb8d9d5b27b6739 (patch) | |
| tree | 2907ec3f298b2b38827060623d3f6e2577dda011 /src/core/socket.c | |
| parent | 7b02ddc2d7077439992a10bb69553f89b5ee5903 (diff) | |
| download | nng-2fbfd7e5c3ad245de2c905720eb8d9d5b27b6739.tar.gz nng-2fbfd7e5c3ad245de2c905720eb8d9d5b27b6739.tar.bz2 nng-2fbfd7e5c3ad245de2c905720eb8d9d5b27b6739.zip | |
Introduce nng_device_aio().
This function is like nng_device(), but runs asynchronously.
Also, this fixes #1503 nng_device causes nng_close to blocking
Diffstat (limited to 'src/core/socket.c')
| -rw-r--r-- | src/core/socket.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/socket.c b/src/core/socket.c index 425499ae..75c9eedc 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -379,6 +379,14 @@ nni_sock_find(nni_sock **sockp, uint32_t id) } void +nni_sock_hold(nni_sock *s) +{ + nni_mtx_lock(&sock_lk); + s->s_ref++; + nni_mtx_unlock(&sock_lk); +} + +void nni_sock_rele(nni_sock *s) { nni_mtx_lock(&sock_lk); |
