summaryrefslogtreecommitdiffstatshomepage
path: root/py/mpstate.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-04-22 22:52:33 +0000
committerDamien George <damien.p.george@gmail.com>2016-06-28 11:28:48 +0100
commit27cc07721b3c3c2d0b9c8678c8a3ddc7fe96cd97 (patch)
tree38016a7b7e2f29c615bfc0dc14261b8ec0bf0173 /py/mpstate.h
parent330165a2cc9a0d4d5d00f13f851412c25d5f4ed2 (diff)
downloadmicropython-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.h5
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__