obgm / libcoap

A CoAP (RFC 7252) implementation in C
Other
777 stars 421 forks source link

locking: Simplify maintenance / debugging /documentation #1417

Closed mrdeep1 closed 1 month ago

mrdeep1 commented 1 month ago

Update the Public API equivalent of the libcoap functions that need to be called when locked with a name suffix of _lkd.

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

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

Tag all the Public API functions that have a _lkd function with COAP_API. COAP_API can then be defined as to what should be done for that function.

Check libcoap library does not call the original Public API function when it should be calling the _lkd function by marking the Public API not _lkd functions as deprecated during the libcoap library build. [Done by the new COAP_API being defined as attribute((deprecated)).]

Work in progress for all the functions that need to be multi-thread safe.