summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2019-05-12 21:48:54 +0800
committerBernard Xiong <[email protected]>2019-05-12 21:48:54 +0800
commit7038465d13531ba26f16d1b402974bfef3f93115 (patch)
treea852b4f8f2410dc3bdf50b18f5680b1af935e3e3 /components
parentbb506e8493b3918a36b4854632e177b4b64f30fe (diff)
[pthreads] Add PTHREAD_NUM_MAX in Kconfig.
Diffstat (limited to 'components')
-rw-r--r--components/libc/Kconfig6
-rw-r--r--components/libc/pthreads/pthread_internal.h3
2 files changed, 9 insertions, 0 deletions
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
{