From 999fa281875c5dea2e954a48fc92a6b1c24353fd Mon Sep 17 00:00:00 2001 From: Jakob Hasse Date: Wed, 12 Apr 2023 18:31:32 +0800 Subject: [PATCH] pthread: removed IRAM code from pthread * Currently, the underlying FreeRTOS API functions used for the pthread implementation are not ISR-safe, hence the removal of IRAM placement. --- components/pthread/pthread.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/pthread/pthread.c b/components/pthread/pthread.c index bde182a7da..979060b17e 100644 --- a/components/pthread/pthread.c +++ b/components/pthread/pthread.c @@ -595,7 +595,7 @@ int pthread_mutex_destroy(pthread_mutex_t *mutex) return 0; } -static int IRAM_ATTR pthread_mutex_lock_internal(esp_pthread_mutex_t *mux, TickType_t tmo) +static int pthread_mutex_lock_internal(esp_pthread_mutex_t *mux, TickType_t tmo) { if (!mux) { return EINVAL; @@ -632,7 +632,7 @@ static int pthread_mutex_init_if_static(pthread_mutex_t *mutex) return res; } -int IRAM_ATTR pthread_mutex_lock(pthread_mutex_t *mutex) +int pthread_mutex_lock(pthread_mutex_t *mutex) { if (!mutex) { return EINVAL; @@ -644,7 +644,7 @@ int IRAM_ATTR pthread_mutex_lock(pthread_mutex_t *mutex) return pthread_mutex_lock_internal((esp_pthread_mutex_t *)*mutex, portMAX_DELAY); } -int IRAM_ATTR pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *timeout) +int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *timeout) { if (!mutex) { return EINVAL; @@ -666,7 +666,7 @@ int IRAM_ATTR pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct times return res; } -int IRAM_ATTR pthread_mutex_trylock(pthread_mutex_t *mutex) +int pthread_mutex_trylock(pthread_mutex_t *mutex) { if (!mutex) { return EINVAL; @@ -678,7 +678,7 @@ int IRAM_ATTR pthread_mutex_trylock(pthread_mutex_t *mutex) return pthread_mutex_lock_internal((esp_pthread_mutex_t *)*mutex, 0); } -int IRAM_ATTR pthread_mutex_unlock(pthread_mutex_t *mutex) +int pthread_mutex_unlock(pthread_mutex_t *mutex) { esp_pthread_mutex_t *mux;