diff options
| author | Damien George | 2017-02-06 15:13:30 +1100 |
|---|---|---|
| committer | Damien George | 2017-02-15 13:28:48 +1100 |
| commit | 05a4859585c4e0a55fca2e7467ba70da6453fdcb (patch) | |
| tree | 70d87f5ac3437b2e46e5b4d2d7b29b9ecced3776 /stmhal/modmachine.c | |
| parent | f6c22a06797735e4a65a91491d8373ba951a798b (diff) | |
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.
Diffstat (limited to 'stmhal/modmachine.c')
| -rw-r--r-- | stmhal/modmachine.c | 5 |
1 files changed, 5 insertions, 0 deletions
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(); |
