From e8e44bf6aa14068c4eaa37e1bd43e99193f2419f Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Tue, 21 May 2024 20:57:57 +0100 Subject: [PATCH] esp-idf: Support multi-threading --- include/coap3/coap_mutex_internal.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/coap3/coap_mutex_internal.h b/include/coap3/coap_mutex_internal.h index 2c69db31bf..aaca90cf6e 100644 --- a/include/coap3/coap_mutex_internal.h +++ b/include/coap3/coap_mutex_internal.h @@ -34,8 +34,13 @@ typedef pthread_mutex_t coap_mutex_t; #define coap_mutex_lock(a) pthread_mutex_lock(a) #define coap_mutex_trylock(a) pthread_mutex_trylock(a) #define coap_mutex_unlock(a) pthread_mutex_unlock(a) +#if defined(ESPIDF_VERSION) +#define coap_thread_pid_t TaskHandle_t +#define coap_thread_pid xTaskGetCurrentTaskHandle() +#else /* !ESPIDF_VERSION */ #define coap_thread_pid_t pthread_t #define coap_thread_pid pthread_self() +#endif /* !ESPIDF_VERSION */ #elif defined(RIOT_VERSION) /* use RIOT's mutex API */