Split recursive mutex into their own functions (was Reduce performance hit of recursive mutex) (#495)

mutex_t and mutex_ are reverted to non recursive versions (pre SDK1.2.0) and new recursive_mutex_t and recursive_mutex_ functions have been added

PICO_MUTEX_ENABLE_SDK120_COMPATIBILITY flag has been added to allow old SDK1.2.0 compatibility (i.e. mutex_t can be used recursively or not) but this is slower (and is will be removed in a future version)
This commit is contained in:
Graham Sanderson
2021-10-20 18:27:59 -05:00
committed by GitHub
parent 9320d192c3
commit 3c72e753b6
5 changed files with 296 additions and 97 deletions

View File

@ -176,7 +176,7 @@ static void __isr __not_in_flash_func(multicore_lockout_handler)(void) {
static void check_lockout_mutex_init(void) {
// use known available lock - we only need it briefly
uint32_t save = hw_claim_lock();
if (!mutex_is_initialzed(&lockout_mutex)) {
if (!mutex_is_initialized(&lockout_mutex)) {
mutex_init(&lockout_mutex);
}
hw_claim_unlock(save);
@ -237,7 +237,7 @@ void multicore_lockout_start_blocking() {
}
static bool multicore_lockout_end_block_until(absolute_time_t until) {
assert(mutex_is_initialzed(&lockout_mutex));
assert(mutex_is_initialized(&lockout_mutex));
if (!mutex_enter_block_until(&lockout_mutex, until)) {
return false;
}