diff options
author | Damien George <damien.p.george@gmail.com> | 2016-04-22 22:53:51 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-06-28 11:28:48 +0100 |
commit | a791be936a79154a1b1e600e5e75d147396847f6 (patch) | |
tree | 58afb39e875df36055e9ac391d76ff4d7324135a /unix/main.c | |
parent | 27cc07721b3c3c2d0b9c8678c8a3ddc7fe96cd97 (diff) |
unix: Add basic thread support using pthreads.
Has the ability to create new threads.
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 dedee28e7..a463d2e10 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 |