rp2: Migrate to the new mp_thread_recursive_mutex_t.

Necessary for GC support, also refactored pendsv usage.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
This commit is contained in:
Angus Gratton
2024-12-10 14:51:10 +11:00
committed by Damien George
parent 4bcbe88e74
commit 3bfedd0f4a
3 changed files with 28 additions and 10 deletions

View File

@@ -84,10 +84,10 @@ void mp_thread_deinit(void) {
assert(get_core_num() == 0);
// Must ensure that core1 is not currently holding the GC lock, otherwise
// it will be terminated while holding the lock.
mp_thread_mutex_lock(&MP_STATE_MEM(gc_mutex), 1);
mp_thread_recursive_mutex_lock(&MP_STATE_MEM(gc_mutex), 1);
multicore_reset_core1();
core1_entry = NULL;
mp_thread_mutex_unlock(&MP_STATE_MEM(gc_mutex));
mp_thread_recursive_mutex_unlock(&MP_STATE_MEM(gc_mutex));
}
void mp_thread_gc_others(void) {