Files
libcoap/include
Jon Shallow 39b79e23b4 multi-threading: Lock resource structure when calling request handlers
If an app request call-back modifies any data associated with a resource,
then multiple threads can attempt to unsafely modify the data at the same time.

Lock the resource when calling the app request handler (as global_lock is
unlocked) to prevent concurrent changes to the resource information.

If the app request handler is definately known to not modify the resource
information, then COAP_RESOURCE_SAFE_REQUEST_HANDLER can be set in the flags
for coap_resource_init().  Usually if there is a PUT, POST, PATCH or IPATCH
handler it is unsafe to set this. Setting this will reduce lock contention.
2026-03-23 19:01:53 +00:00
..