aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/aio_test.c8
-rw-r--r--src/core/socket.c4
2 files changed, 5 insertions, 7 deletions
diff --git a/src/core/aio_test.c b/src/core/aio_test.c
index afce43e2..18f9baeb 100644
--- a/src/core/aio_test.c
+++ b/src/core/aio_test.c
@@ -294,7 +294,7 @@ test_sleep_loop(void)
NUTS_PASS(nng_cv_alloc(&sl.cv, sl.mx));
start = nng_clock();
- nng_sleep_aio(50, sl.aio);
+ nng_sleep_aio(100, sl.aio);
nng_mtx_lock(sl.mx);
while (!sl.done) {
nng_cv_until(sl.cv, 2000);
@@ -330,7 +330,7 @@ test_sleep_cancel(void)
start = nng_clock();
nng_sleep_aio(100, sl.aio);
- nng_msleep(125);
+ nng_msleep(150);
nng_aio_cancel(sl.aio);
nng_mtx_lock(sl.mx);
while (!sl.done) {
@@ -338,8 +338,8 @@ test_sleep_cancel(void)
}
nng_mtx_unlock(sl.mx);
dur = (nng_duration) (nng_clock() - start);
- NUTS_ASSERT(dur >= 50);
- NUTS_ASSERT(dur <= 200); // allow for sloppy clocks
+ NUTS_ASSERT(dur >= 100);
+ NUTS_ASSERT(dur <= 500); // allow for sloppy clocks
NUTS_ASSERT(sl.done);
NUTS_FAIL(sl.result, NNG_ECANCELED);
NUTS_ASSERT(sl.count == 1);
diff --git a/src/core/socket.c b/src/core/socket.c
index 82267287..90a99c20 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -519,13 +519,11 @@ sock_destroy(nni_sock *s)
s->s_sock_ops.sock_fini(s->s_data);
}
+ nni_mtx_lock(&s->s_mx);
while ((sopt = nni_list_first(&s->s_options)) != NULL) {
nni_list_remove(&s->s_options, sopt);
nni_free_opt(sopt);
}
-
- // This exists to silence a false positive in helgrind.
- nni_mtx_lock(&s->s_mx);
nni_mtx_unlock(&s->s_mx);
nni_msgq_fini(s->s_urq);