#2743 - Implemented ability to core affinity and thread name for pthreads and thus also for std::thread.

This commit is contained in:
Per Malmberg
2018-11-28 20:40:32 +01:00
parent a0468b2bd6
commit 71f57931bd
10 changed files with 242 additions and 11 deletions

View File

@@ -14,6 +14,9 @@
#pragma once
#include "esp_err.h"
#include <freertos/FreeRTOSConfig.h>
#ifdef __cplusplus
extern "C" {
#endif
@@ -24,11 +27,22 @@ extern "C" {
/** pthread configuration structure that influences pthread creation */
typedef struct {
size_t stack_size; ///< the stack size of the pthread
size_t prio; ///< the thread's priority
bool inherit_cfg; ///< inherit this configuration further
size_t stack_size; ///< The stack size of the pthread
size_t prio; ///< The thread's priority
bool inherit_cfg; ///< Inherit this configuration further
const char* thread_name; ///< The thread name.
int pin_to_core; ///< The core id to pin the thread to. Has the same value range as xCoreId argument of xTaskCreatePinnedToCore.
} esp_pthread_cfg_t;
/**
* @brief Creates a default pthread configuration based
* on the values set via menuconfig.
*
* @return
* A default configuration structure.
*/
esp_pthread_cfg_t esp_pthread_get_default_config();
/**
* @brief Configure parameters for creating pthread
*