mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-11 11:20:40 +03:00
FreeRTOS/LwIP: Support getting thread_id for locking
This commit is contained in:
1 parent
5fa14f6a74
commit
0eff6a4ed7
1 file changed
+8
-2
@@ -109,8 +109,14 @@ typedef sys_mutex_t coap_mutex_t;
|
||||
#define coap_mutex_destroy(a) sys_mutex_set_invalid(a)
|
||||
#define coap_mutex_lock(a) sys_mutex_lock(a)
|
||||
#define coap_mutex_unlock(a) sys_mutex_unlock(a)
|
||||
#define coap_thread_pid_t sys_thread_t
|
||||
#define coap_thread_pid (coap_thread_pid_t)1
|
||||
#ifdef _WIN32
|
||||
#define DWORD sys_thread_t
|
||||
#define coap_thread_pid GetCurrentThreadId()
|
||||
#else /* ! _WIN32 */
|
||||
/* Assume this is therefore FreeRTOS */
|
||||
#define caop_thread_pid_t TaskHandle_t
|
||||
#define coap_thread_pid xTaskGetCurrentTaskHandle()
|
||||
#endif /* ! _WIN32 */
|
||||
|
||||
#if COAP_THREAD_RECURSIVE_CHECK
|
||||
#error COAP_THREAD_RECURSIVE_CHECK not supported (no coap_mutex_trylock())
|
||||
|
||||
Reference in new issue
Block a user