aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/taskq.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/taskq.c b/src/core/taskq.c
index 09e822df..e63e33c7 100644
--- a/src/core/taskq.c
+++ b/src/core/taskq.c
@@ -228,6 +228,11 @@ nni_taskq_sys_init(void)
#else
nthrs = NNG_NUM_TASKQ_THREADS;
#endif
+#if NNG_MAX_TASKQ_THREADS > 0
+ if (nthrs > NNG_MAX_TASKQ_THREADS) {
+ nthrs = NNG_MAX_TASKQ_THREADS;
+ }
+#endif
return (nni_taskq_init(&nni_taskq_systq, nthrs));
}