From 05a4859585c4e0a55fca2e7467ba70da6453fdcb Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 6 Feb 2017 15:13:30 +1100 Subject: stmhal: Implement a proper thread scheduler. This patch changes the threading implementation from simple round-robin with busy waits on mutexs, to proper scheduling whereby threads that are waiting on a mutex are only scheduled when the mutex becomes available. --- stmhal/modmachine.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'stmhal/modmachine.c') diff --git a/stmhal/modmachine.c b/stmhal/modmachine.c index 4a3fe1ec9..16c50079d 100644 --- a/stmhal/modmachine.c +++ b/stmhal/modmachine.c @@ -41,6 +41,7 @@ #include "extmod/vfs_fat.h" #include "gccollect.h" #include "irq.h" +#include "pybthread.h" #include "rng.h" #include "storage.h" #include "pin.h" @@ -159,6 +160,10 @@ STATIC mp_obj_t machine_info(mp_uint_t n_args, const mp_obj_t *args) { } } + #if MICROPY_PY_THREAD + pyb_thread_dump(); + #endif + if (n_args == 1) { // arg given means dump gc allocation table gc_dump_alloc_table(); -- cgit v1.2.3