mirror of
https://github.com/espressif/esp-idf.git
synced 2026-05-06 08:37:29 +02:00
#2743 - Implemented ability to core affinity and thread name for pthreads and thus also for std::thread.
This commit is contained in:
@@ -8,6 +8,8 @@ This module offers Espressif specific extensions to the pthread library that can
|
||||
* Stack size of the pthreads
|
||||
* Priority of the created pthreads
|
||||
* Inheriting this configuration across threads
|
||||
* Thread name
|
||||
* Core affinity / core pinning.
|
||||
|
||||
Example to tune the stack size of the pthread:
|
||||
|
||||
@@ -19,7 +21,7 @@ Example to tune the stack size of the pthread:
|
||||
{
|
||||
pthread_t t1;
|
||||
|
||||
esp_pthread_cfg_t cfg;
|
||||
esp_pthread_cfg_t cfg = esp_create_default_pthread_config();
|
||||
cfg.stack_size = (4 * 1024);
|
||||
esp_pthread_set_cfg(&cfg);
|
||||
|
||||
@@ -50,7 +52,7 @@ The API can also be used for inheriting the settings across threads. For example
|
||||
|
||||
pthread_t t1;
|
||||
|
||||
esp_pthread_cfg_t cfg;
|
||||
esp_pthread_cfg_t cfg = esp_create_default_pthread_config();
|
||||
cfg.stack_size = (4 * 1024);
|
||||
cfg.inherit_cfg = true;
|
||||
esp_pthread_set_cfg(&cfg);
|
||||
|
||||
Reference in New Issue
Block a user