summaryrefslogtreecommitdiff
path: root/py/runtime.h
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2022-07-01 11:22:24 +1000
committerDamien George <damien@micropython.org>2022-07-12 15:54:33 +1000
commit8db99f11a7da84e29c2e9b37e9f224ab424d73e1 (patch)
treea9393543c5aa3bdb0e2285ee0af2cef24a5e3709 /py/runtime.h
parent1329155b969386623200feff776e87336bf8e2e7 (diff)
py/scheduler: De-inline and fix race with pending exception / scheduler.
The optimisation that allows a single check in the VM for either a pending exception or non-empty scheduler queue doesn't work when threading is enabled, as one thread can clear the sched_state if it has no pending exception, meaning the thread with the pending exception will never see it. This removes that optimisation for threaded builds. Also fixes a race in non-scheduler builds where get-and-clear of the pending exception is not protected by the atomic section. Also removes the bulk of the inlining of pending exceptions and scheduler handling from the VM. This just costs code size and complexity at no performance benefit. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'py/runtime.h')
-rw-r--r--py/runtime.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/py/runtime.h b/py/runtime.h
index 4393fbfa8..779b66f2b 100644
--- a/py/runtime.h
+++ b/py/runtime.h
@@ -76,7 +76,6 @@ void mp_deinit(void);
void mp_sched_exception(mp_obj_t exc);
void mp_sched_keyboard_interrupt(void);
void mp_handle_pending(bool raise_exc);
-void mp_handle_pending_tail(mp_uint_t atomic_state);
#if MICROPY_ENABLE_SCHEDULER
void mp_sched_lock(void);