locking: Simplify maintenance / debugging /documentation

Update libcoap functions that need to be called locked with a name
suffix of _locked.

Move matching functions out of coap_threadsafe.c to be coded just ahead
of the newly renamed _locked function.

Properly define the _locked function in the appropriate _internal.h file
for documentation, removing the #defines from coap_threadsafe_internal.h.

Work in progress for all the functions.

Remove coap_lock_* requirements for testdriver (coap_delete_node()).
This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2024-05-15 15:50:14 +01:00
1 parent 6673be3b43
commit 622050a957
11 files changed
+397 -181

No files matched your search

-3
View File
@@ -320,15 +320,12 @@ t_sendqueue_tests_create(void) {
static int
t_sendqueue_tests_remove(void) {
size_t n;
/* As coap_delete_node() is not in the Public API, need to lock */
coap_lock_lock(ctx, return 1);
for (n = 0; n < sizeof(node)/sizeof(coap_queue_t *); n++) {
if (node[n]) {
coap_delete_node(node[n]);
node[n] = NULL;
}
}
coap_lock_unlock(ctx);
coap_free_context(ctx);
ctx = NULL;
return 0;