From 7038465d13531ba26f16d1b402974bfef3f93115 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Sun, 12 May 2019 21:48:54 +0800 Subject: [PATCH] [pthreads] Add PTHREAD_NUM_MAX in Kconfig. --- components/libc/Kconfig | 6 ++++++ components/libc/pthreads/pthread_internal.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/components/libc/Kconfig b/components/libc/Kconfig index b2abe69850..43d9330102 100644 --- a/components/libc/Kconfig +++ b/components/libc/Kconfig @@ -8,6 +8,12 @@ config RT_USING_PTHREADS bool "Enable pthreads APIs" default n +if RT_USING_PTHREADS + config PTHREAD_NUM_MAX + int "Maximum number of pthreads" + default 8 +endif + if RT_USING_LIBC && RT_USING_DFS config RT_USING_POSIX bool "Enable POSIX layer for poll/select, stdin etc" diff --git a/components/libc/pthreads/pthread_internal.h b/components/libc/pthreads/pthread_internal.h index 304701584f..a6706ca091 100644 --- a/components/libc/pthreads/pthread_internal.h +++ b/components/libc/pthreads/pthread_internal.h @@ -30,7 +30,10 @@ struct _pthread_key_data }; typedef struct _pthread_key_data _pthread_key_data_t; +#ifndef PTHREAD_NUM_MAX #define PTHREAD_NUM_MAX 32 +#endif + #define PTHREAD_MAGIC 0x70746873 struct _pthread_data {