Browse Source

[pthreads] Add PTHREAD_NUM_MAX in Kconfig.

Bernard Xiong 6 years ago
parent
commit
7038465d13
2 changed files with 9 additions and 0 deletions
  1. 6 0
      components/libc/Kconfig
  2. 3 0
      components/libc/pthreads/pthread_internal.h

+ 6 - 0
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"

+ 3 - 0
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
 {