refactor(pthread): decouple pthread_init from esp_system

This commit is contained in:
Marius Vikhammer
2024-02-05 17:38:53 +08:00
parent ae31dfe4b8
commit 2bb16ed45b
5 changed files with 9 additions and 10 deletions

View File

@@ -15,6 +15,7 @@
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "esp_private/startup_internal.h"
#if CONFIG_SPIRAM
#include "esp_private/freertos_idf_additions_priv.h"
#endif
@@ -71,6 +72,11 @@ static void esp_pthread_cfg_key_destructor(void *value)
free(value);
}
ESP_SYSTEM_INIT_FN(init_pthread, CORE, BIT(0), 120)
{
return esp_pthread_init();
}
esp_err_t esp_pthread_init(void)
{
if (pthread_key_create(&s_pthread_cfg_key, esp_pthread_cfg_key_destructor) != 0) {