|
libcoap 4.3.5-develop-f0533d3
|
Internal API for Multi-thread Locking Support. More...
Collaboration diagram for Multi-thread Support:Macros | |
| #define | coap_lock_lock(failed) |
| Dummy for no thread-safe code. | |
| #define | coap_lock_specific_lock(lock, failed) |
| Dummy for no thread-safe code. | |
| #define | coap_lock_unlock() |
| Dummy for no thread-safe code. | |
| #define | coap_lock_specific_unlock(lock) |
| Dummy for no thread-safe code. | |
| #define | coap_lock_init(lock) |
| Dummy for no thread-safe code. | |
| #define | coap_lock_check_locked() {} |
| Dummy for no thread-safe code. | |
| #define | coap_lock_callback(func) func |
| Dummy for no thread-safe code. | |
| #define | coap_lock_callback_ret(r, func) (r) = func |
| Dummy for no thread-safe code. | |
| #define | coap_lock_callback_release(func, failed) func |
| Dummy for no thread-safe code. | |
| #define | coap_lock_specific_callback_release(lock, func, failed) func |
| Dummy for no thread-safe code. | |
| #define | coap_lock_callback_ret_release(r, func, failed) (r) = func |
| Dummy for no thread-safe code. | |
| #define | coap_lock_invert(alt_lock, failed) alt_lock |
| Dummy for no thread-safe code. | |
Typedefs | |
| typedef coap_mutex_t | coap_lock_t |
Internal API for Multi-thread Locking Support.
| #define coap_lock_callback | ( | func | ) | func |
Dummy for no thread-safe code.
libcoap library code. Invoke an app callback, leaving global_lock locked.
Called when Locked
| func | app call-back function to invoke. |
Definition at line 647 of file coap_threadsafe_internal.h.
| #define coap_lock_callback_release | ( | func, | |
| failed | |||
| ) | func |
Dummy for no thread-safe code.
libcoap library code. Invoke an app callback, unlocking global_lock first.
Called when Locked
| func | app call-back function to invoke. |
| failed | Code to execute on (re-)lock failure. |
Definition at line 676 of file coap_threadsafe_internal.h.
| #define coap_lock_callback_ret | ( | r, | |
| func | |||
| ) | (r) = func |
Dummy for no thread-safe code.
libcoap library code. Invoke an app callback that has a return value, leaving global_lock locked.
Called when Locked
| r | Return value from func. |
| func | app call-back function to invoke. |
Definition at line 662 of file coap_threadsafe_internal.h.
| #define coap_lock_callback_ret_release | ( | r, | |
| func, | |||
| failed | |||
| ) | (r) = func |
Dummy for no thread-safe code.
libcoap library code. Invoke an app callback that has a return value, unlocking global_lock first.
Called when Locked (need to unlock over app call-back) Unlocked by thread free'ing off context
| r | Return value from func. |
| func | app call-back function to invoke. |
| failed | Code to execute on lock failure |
Definition at line 705 of file coap_threadsafe_internal.h.
| #define coap_lock_check_locked | ( | ) | {} |
Dummy for no thread-safe code.
libcoap library code. Check that global_lock is locked.
Definition at line 634 of file coap_threadsafe_internal.h.
| #define coap_lock_init | ( | lock | ) |
Dummy for no thread-safe code.
libcoap library code. Initialize the global_lock.
Definition at line 627 of file coap_threadsafe_internal.h.
| #define coap_lock_invert | ( | alt_lock, | |
| failed | |||
| ) | alt_lock |
Dummy for no thread-safe code.
libcoap library code. Lock an alternative lock. To prevent locking order issues, global_lock is unlocked, the alternative lock is locked and then global_lock is re-locked.
Called when Locked (need to unlock over locking of alternative lock)
| alt_lock | Alternative lock locking code. |
| failed | Code to execute on lock failure. |
Definition at line 721 of file coap_threadsafe_internal.h.
| #define coap_lock_lock | ( | failed | ) |
Dummy for no thread-safe code.
libcoap library code. Lock the global_lock.
Invoked when Not locked at all Locked, app call-back, call from app call-back Locked, app call-back, call from app call-back, app call-back, call from app call-back Result global_lock locked. global_lock not locked if libcoap not started and failed is executed. failed must be code that skips doing the lock protected code.
| failed | Code to execute on lock failure. |
Definition at line 578 of file coap_threadsafe_internal.h.
| #define coap_lock_specific_callback_release | ( | lock, | |
| func, | |||
| failed | |||
| ) | func |
Dummy for no thread-safe code.
libcoap library code. Invoke an app callback.
| lock | lock to unlock before callback. |
| func | app call-back function to invoke. |
| failed | Code to execute on (re-)lock failure. |
Definition at line 688 of file coap_threadsafe_internal.h.
| #define coap_lock_specific_lock | ( | lock, | |
| failed | |||
| ) |
Dummy for no thread-safe code.
libcoap library code. Lock the specific lock.
Invoked when Not locked at all Locked, app call-back, call from app call-back Locked, app call-back, call from app call-back, app call-back, call from app call-back Result global_lock locked. global_lock not locked if libcoap not started and failed is executed. failed must be code that skips doing the lock protected code.
| lock | The specifc lock to lock. |
| failed | Code to execute on lock failure. |
Definition at line 598 of file coap_threadsafe_internal.h.
| #define coap_lock_specific_unlock | ( | lock | ) |
Dummy for no thread-safe code.
libcoap library code. Unlock the specific lock.
Unlocked when Same thread locked context
| lock | The specifc lock to unlock. |
Definition at line 620 of file coap_threadsafe_internal.h.
| #define coap_lock_unlock | ( | ) |
Dummy for no thread-safe code.
libcoap library code. Unlock the global_lock.
Unlocked when Same thread locked context
Definition at line 608 of file coap_threadsafe_internal.h.
| typedef coap_mutex_t coap_lock_t |
Definition at line 559 of file coap_threadsafe_internal.h.