multi-thread: Add in thread safe support

Optional compile time thread safe code supported.

Locking is done at the coap_context_t level, and if enabled is primarily
done coap_threadsafe.c and coap_threadsafe_internal.h.

coap_threadsafe_internal.h causes coap_X() to get mapped to coap_X_locked()
throughout the libcoap library code with the exception of coap_threadsafe.c
if thread safe is enabled.
This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2023-11-25 11:41:26 +00:00
1 parent 6b4fac968d
commit c69c5d5af0
50 files changed
+1998 -130

No files matched your search

+1
View File
@@ -284,6 +284,7 @@ t_sendqueue_tests_create(void) {
addr.addr.sin6.sin6_port = htons(COAP_DEFAULT_PORT);
ctx = coap_new_context(&addr);
coap_lock_lock(ctx, return 1);
addr.addr.sin6.sin6_addr = in6addr_loopback;
session = coap_new_client_session(ctx, NULL, &addr, COAP_PROTO_UDP);