diff --git a/DESCRIPTION b/DESCRIPTION index 7fe133cb0..dfff973c9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: nanonext Type: Package Title: NNG (Nanomsg Next Gen) Lightweight Messaging Library -Version: 1.3.0.9011 +Version: 1.3.0.9012 Description: R binding for NNG (Nanomsg Next Gen), a successor to ZeroMQ. NNG is a socket library implementing 'Scalability Protocols', a reliable, high-performance standard for common communications patterns including diff --git a/NEWS.md b/NEWS.md index b1a7e5333..fed1ee186 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# nanonext 1.3.0.9011 (development) +# nanonext 1.3.0.9012 (development) #### Updates diff --git a/src/init.c b/src/init.c index 7f792b6e0..f8818d12d 100644 --- a/src/init.c +++ b/src/init.c @@ -22,11 +22,11 @@ void (*eln2)(void (*)(void *), void *, double, int) = NULL; uint8_t special_bit = 0; -extern nng_thread *nano_wait_thr; -extern nng_aio *nano_shared_aio; -extern nng_mtx *nano_wait_mtx; -extern nng_cv *nano_wait_cv; -extern int nano_wait_condition; +nng_mtx *nano_wait_mtx; +nng_cv *nano_wait_cv; +nng_thread *nano_wait_thr = NULL; +nng_aio *nano_shared_aio = NULL; +int nano_wait_condition = 0; SEXP nano_AioSymbol; SEXP nano_ContextSymbol; diff --git a/src/thread.c b/src/thread.c index 14a481ced..0ec191cc4 100644 --- a/src/thread.c +++ b/src/thread.c @@ -22,11 +22,11 @@ // threads callable and messenger ---------------------------------------------- -nng_mtx *nano_wait_mtx = NULL; -nng_cv *nano_wait_cv = NULL; -nng_thread *nano_wait_thr = NULL; -nng_aio *nano_shared_aio = NULL; -int nano_wait_condition = 0; +extern nng_thread *nano_wait_thr; +extern nng_aio *nano_shared_aio; +extern nng_mtx *nano_wait_mtx; +extern nng_cv *nano_wait_cv; +extern int nano_wait_condition; // # nocov start // tested interactively @@ -462,7 +462,7 @@ SEXP rnng_wait_thread_create(SEXP x) { } SEXP rnng_thread_shutdown(void) { - if (nano_wait_thr) { + if (nano_wait_thr != NULL) { if (nano_shared_aio != NULL) nng_aio_stop(nano_shared_aio); nng_mtx_lock(nano_wait_mtx); @@ -472,7 +472,6 @@ SEXP rnng_thread_shutdown(void) { nng_thread_destroy(nano_wait_thr); nng_cv_free(nano_wait_cv); nng_mtx_free(nano_wait_mtx); - nano_wait_thr = NULL; } return R_NilValue; }