diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-08-14 01:07:14 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-08-14 13:43:01 -0700 |
| commit | 827aed05d352c470c8b4b8a7e232e21e1cd19313 (patch) | |
| tree | efa08531fd37a08de7eff82cb9f946be6a0996ae /src/core | |
| parent | 46c0fb89b06331b44a51cb7e56f0fb2fe3281a4b (diff) | |
| download | nng-827aed05d352c470c8b4b8a7e232e21e1cd19313.tar.gz nng-827aed05d352c470c8b4b8a7e232e21e1cd19313.tar.bz2 nng-827aed05d352c470c8b4b8a7e232e21e1cd19313.zip | |
Idempotent taskq finalizers.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/taskq.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/taskq.c b/src/core/taskq.c index 8d42701e..e0fc456c 100644 --- a/src/core/taskq.c +++ b/src/core/taskq.c @@ -149,7 +149,9 @@ nni_taskq_fini(nni_taskq *tq) // First drain the taskq completely. This is necessary since some // tasks that are presently running may need to schedule additional // tasks, and we don't want those to block. - + if (tq == NULL) { + return; + } if (tq->tq_run) { nni_mtx_lock(&tq->tq_mtx); nni_taskq_drain_locked(tq); @@ -274,4 +276,5 @@ void nni_taskq_sys_fini(void) { nni_taskq_fini(nni_taskq_systq); + nni_taskq_systq = NULL; } |
