aboutsummaryrefslogtreecommitdiff
path: root/py/runtime.c
diff options
context:
space:
mode:
authorDavid Lechner <david@pybricks.com>2021-05-10 21:53:22 -0500
committerDamien George <damien@micropython.org>2021-06-19 09:43:44 +1000
commitca920f72184c50f61002aa9d5cd01555b1e28b7b (patch)
treea46b6cb9c91a275015b351443d1cb1181d8c5d14 /py/runtime.c
parent7c51cb2307eaca1a1ccc071e0bb5eb4a5f734610 (diff)
py/mpstate: Make exceptions thread-local.
This moves mp_pending_exception from mp_state_vm_t to mp_state_thread_t. This allows exceptions to be scheduled on a specific thread. Signed-off-by: David Lechner <david@pybricks.com>
Diffstat (limited to 'py/runtime.c')
-rw-r--r--py/runtime.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/runtime.c b/py/runtime.c
index 1ca0702e1..cda26a9cf 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -62,7 +62,7 @@ void mp_init(void) {
qstr_init();
// no pending exceptions to start with
- MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL;
+ MP_STATE_THREAD(mp_pending_exception) = MP_OBJ_NULL;
#if MICROPY_ENABLE_SCHEDULER
MP_STATE_VM(sched_state) = MP_SCHED_IDLE;
MP_STATE_VM(sched_idx) = 0;