summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/rp2/mpthreadport.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ports/rp2/mpthreadport.c b/ports/rp2/mpthreadport.c
index 8a36cfca7..cdb5945d2 100644
--- a/ports/rp2/mpthreadport.c
+++ b/ports/rp2/mpthreadport.c
@@ -52,12 +52,12 @@ void mp_thread_deinit(void) {
}
void mp_thread_gc_others(void) {
- if (get_core_num() == 0) {
- // GC running on core0, trace core1's stack, if it's running.
- if (core1_entry != NULL) {
- gc_collect_root((void **)core1_stack, core1_stack_num_words);
- }
- } else {
+ if (core1_entry != NULL) {
+ // Collect core1's stack if it is active.
+ gc_collect_root((void **)&core1_stack, 1);
+ gc_collect_root((void **)&core1_arg, 1);
+ }
+ if (get_core_num() == 1) {
// GC running on core1, trace core0's stack.
gc_collect_root((void **)&__StackBottom, (&__StackTop - &__StackBottom) / sizeof(uintptr_t));
}