libcoap 4.3.5b
Loading...
Searching...
No Matches
Multi-thread Support

Internal API for Multi-thread Locking Support. More...

+ Collaboration diagram for Multi-thread Support:

Macros

#define coap_lock_lock(c, failed)
 Dummy for no thread-safe code.
 
#define coap_lock_specific_lock(lock, failed)
 Dummy for no thread-safe code.
 
#define coap_lock_unlock(c)
 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(c)
 Dummy for no thread-safe code.
 
#define coap_lock_callback(c, func)
 Dummy for no thread-safe code.
 
#define coap_lock_callback_ret(r, c, func)
 Dummy for no thread-safe code.
 
#define coap_lock_callback_release(c, func, failed)
 Dummy for no thread-safe code.
 
#define coap_lock_specific_callback_release(lock, func, failed)
 Dummy for no thread-safe code.
 
#define coap_lock_callback_ret_release(r, c, func, failed)
 Dummy for no thread-safe code.
 
#define coap_lock_invert(c, alt_lock, failed)
 Dummy for no thread-safe code.
 

Typedefs

typedef coap_mutex_t coap_lock_t
 

Detailed Description

Internal API for Multi-thread Locking Support.

Macro Definition Documentation

◆ coap_lock_callback

#define coap_lock_callback ( c,
func )
Value:
func

Dummy for no thread-safe code.

libcoap library code. Invoke an app callback, leaving global_lock locked.

Called when Locked

Parameters
cContext.
funcapp call-back function to invoke.

Definition at line 663 of file coap_threadsafe_internal.h.

◆ coap_lock_callback_release

#define coap_lock_callback_release ( c,
func,
failed )
Value:
func

Dummy for no thread-safe code.

libcoap library code. Invoke an app callback, unlocking global_lock first.

Called when Locked

Parameters
cContext.
funcapp call-back function to invoke.
failedCode to execute on (re-)lock failure.

Definition at line 694 of file coap_threadsafe_internal.h.

◆ coap_lock_callback_ret

#define coap_lock_callback_ret ( r,
c,
func )
Value:
(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

Parameters
rReturn value from func.
cContext.
funcapp call-back function to invoke.

Definition at line 679 of file coap_threadsafe_internal.h.

◆ coap_lock_callback_ret_release

#define coap_lock_callback_ret_release ( r,
c,
func,
failed )
Value:
(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

Parameters
rReturn value from func.
cContext to unlock.
funcapp call-back function to invoke.
failedCode to execute on lock failure

Definition at line 724 of file coap_threadsafe_internal.h.

◆ coap_lock_check_locked

#define coap_lock_check_locked ( c)
Value:
{}

Dummy for no thread-safe code.

libcoap library code. Check that global_lock is locked.

Definition at line 649 of file coap_threadsafe_internal.h.

◆ coap_lock_init

#define coap_lock_init ( lock)

Dummy for no thread-safe code.

libcoap library code. Initialize the global_lock.

Definition at line 642 of file coap_threadsafe_internal.h.

◆ coap_lock_invert

#define coap_lock_invert ( c,
alt_lock,
failed )
Value:
func

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)

Parameters
cContext.
alt_lockAlternative lock locking code.
failedCode to execute on lock failure.

Definition at line 741 of file coap_threadsafe_internal.h.

◆ coap_lock_lock

#define coap_lock_lock ( c,
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.

Parameters
cContext.
failedCode to execute on lock failure.

Definition at line 591 of file coap_threadsafe_internal.h.

◆ coap_lock_specific_callback_release

#define coap_lock_specific_callback_release ( lock,
func,
failed )
Value:
func

Dummy for no thread-safe code.

libcoap library code. Invoke an app callback.

Parameters
locklock to unlock before callback.
funcapp call-back function to invoke.
failedCode to execute on (re-)lock failure.

Definition at line 706 of file coap_threadsafe_internal.h.

◆ coap_lock_specific_lock

#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.

Parameters
lockThe specifc lock to lock.
failedCode to execute on lock failure.

Definition at line 611 of file coap_threadsafe_internal.h.

◆ coap_lock_specific_unlock

#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

Parameters
lockThe specifc lock to unlock.

Definition at line 635 of file coap_threadsafe_internal.h.

◆ coap_lock_unlock

#define coap_lock_unlock ( c)

Dummy for no thread-safe code.

libcoap library code. Unlock the global_lock.

Unlocked when Same thread locked context

Parameters
cContext.

Definition at line 623 of file coap_threadsafe_internal.h.

Typedef Documentation

◆ coap_lock_t

Definition at line 571 of file coap_threadsafe_internal.h.