diff options
author | Damien George <damien.p.george@gmail.com> | 2016-04-22 22:52:33 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-06-28 11:28:48 +0100 |
commit | 27cc07721b3c3c2d0b9c8678c8a3ddc7fe96cd97 (patch) | |
tree | 38016a7b7e2f29c615bfc0dc14261b8ec0bf0173 /py/mpstate.h | |
parent | 330165a2cc9a0d4d5d00f13f851412c25d5f4ed2 (diff) | |
download | micropython-27cc07721b3c3c2d0b9c8678c8a3ddc7fe96cd97.tar.gz micropython-27cc07721b3c3c2d0b9c8678c8a3ddc7fe96cd97.zip |
py: Add basic _thread module, with ability to start a new thread.
Diffstat (limited to 'py/mpstate.h')
-rw-r--r-- | py/mpstate.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/py/mpstate.h b/py/mpstate.h index 824aba1ff9..18bec09e42 100644 --- a/py/mpstate.h +++ b/py/mpstate.h @@ -201,6 +201,11 @@ extern mp_state_ctx_t mp_state_ctx; #define MP_STATE_VM(x) (mp_state_ctx.vm.x) #define MP_STATE_MEM(x) (mp_state_ctx.mem.x) +#if MICROPY_PY_THREAD +extern mp_state_thread_t *mp_thread_get_state(void); +#define MP_STATE_THREAD(x) (mp_thread_get_state()->x) +#else #define MP_STATE_THREAD(x) (mp_state_ctx.thread.x) +#endif #endif // __MICROPY_INCLUDED_PY_MPSTATE_H__ |