There was an error while loading. Please reload this page.
1 parent d677023 commit 5d4bfceCopy full SHA for 5d4bfce
py/mpstate.h
@@ -297,8 +297,10 @@ extern mp_state_ctx_t mp_state_ctx;
297
#if MICROPY_PY_THREAD
298
extern mp_state_thread_t *mp_thread_get_state(void);
299
#define MP_STATE_THREAD(x) (mp_thread_get_state()->x)
300
+#define mp_thread_is_main_thread() (mp_thread_get_state() == &mp_state_ctx.thread)
301
#else
302
#define MP_STATE_THREAD(x) MP_STATE_MAIN_THREAD(x)
303
+#define mp_thread_is_main_thread() (true)
304
#endif
305
306
#endif // MICROPY_INCLUDED_PY_MPSTATE_H
0 commit comments