From 713b80f440cb414cd0b856bde0ea1b31f939777f Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 9 Nov 2024 23:45:21 -0800 Subject: refactor initialization/finalization Applications must now call nng_init(), but they can supply a set of parameters optionally. The code is now safe for multiple libraries to do this concurrently, meaning nng_fini no longer can race against another instance starting up. The nni_init checks on all public APIs are removed now. --- src/core/taskq.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/core/taskq.h') diff --git a/src/core/taskq.h b/src/core/taskq.h index ccc54f61..498b4f37 100644 --- a/src/core/taskq.h +++ b/src/core/taskq.h @@ -1,5 +1,5 @@ // -// Copyright 2022 Staysail Systems, Inc. +// Copyright 2024 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // // This software is supplied under the terms of the MIT License, a @@ -14,6 +14,7 @@ #include "core/defs.h" #include "core/list.h" #include "core/platform.h" +#include "nng/nng.h" typedef struct nni_taskq nni_taskq; typedef struct nni_task nni_task; @@ -60,7 +61,7 @@ extern void nni_task_init(nni_task *, nni_taskq *, nni_cb, void *); // it reschedules the task.) extern void nni_task_fini(nni_task *); -extern int nni_taskq_sys_init(void); +extern int nni_taskq_sys_init(nng_init_params *); extern void nni_taskq_sys_fini(void); // nni_task implementation details are not to be used except by the -- cgit v1.2.3-70-g09d2