diff options
Diffstat (limited to 'unix/main.c')
-rw-r--r-- | unix/main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/unix/main.c b/unix/main.c index dedee28e7f..a463d2e10a 100644 --- a/unix/main.c +++ b/unix/main.c @@ -45,6 +45,7 @@ #include "py/gc.h" #include "py/stackctrl.h" #include "py/mphal.h" +#include "py/mpthread.h" #include "extmod/misc.h" #include "genhdr/mpversion.h" #include "input.h" @@ -379,6 +380,9 @@ STATIC void set_sys_argv(char *argv[], int argc, int start_arg) { MP_NOINLINE int main_(int argc, char **argv); int main(int argc, char **argv) { + #if MICROPY_PY_THREAD + mp_thread_init(); + #endif // We should capture stack top ASAP after start, and it should be // captured guaranteedly before any other stack variables are allocated. // For this, actual main (renamed main_) should not be inlined into |