Skip to content

Commit

Permalink
Locking: Use single global lock instead of context lock
Browse files Browse the repository at this point in the history
When context is de-allocated, other threads can still access the
context lock held within context. Indicating being freed when
coap_free_context() was called worked in most cases, but not all.
  • Loading branch information
mrdeep1 committed Jul 17, 2024
1 parent af7da45 commit f9c7223
Show file tree
Hide file tree
Showing 6 changed files with 265 additions and 307 deletions.
6 changes: 0 additions & 6 deletions include/coap3/coap_net_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,6 @@ struct coap_context_t {
basis */
#endif /* COAP_SERVER_SUPPORT */
uint32_t block_mode; /**< Zero or more COAP_BLOCK_ or'd options */
#if COAP_THREAD_SAFE
/**
* Context lock for multi-thread support
*/
coap_lock_t lock;
#endif /* COAP_THREAD_SAFE */
};

/**
Expand Down
Loading

0 comments on commit f9c7223

Please sign in to comment.