mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 04:04:31 +02:00
Merge branch 'bugfix/pthread_thread_size' into 'master'
pthread: Transform the units of the stack size to the FreeRTOS domain Closes IDFGH-603 See merge request idf/esp-idf!4375
This commit is contained in:
@@ -286,7 +286,11 @@ int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
|
|||||||
pthread->task_arg = task_arg;
|
pthread->task_arg = task_arg;
|
||||||
BaseType_t res = xTaskCreatePinnedToCore(&pthread_task_func,
|
BaseType_t res = xTaskCreatePinnedToCore(&pthread_task_func,
|
||||||
task_name,
|
task_name,
|
||||||
stack_size,
|
// stack_size is in bytes. This transformation ensures that the units are
|
||||||
|
// transformed to the units used in FreeRTOS.
|
||||||
|
// Note: float division of ceil(m / n) ==
|
||||||
|
// integer division of (m + n - 1) / n
|
||||||
|
(stack_size + sizeof(StackType_t) - 1) / sizeof(StackType_t),
|
||||||
task_arg,
|
task_arg,
|
||||||
prio,
|
prio,
|
||||||
&xHandle,
|
&xHandle,
|
||||||
|
Reference in New Issue
Block a user