From 2cfbe5bc0fe2c8ed24c6f35abbc82ef8415d17e4 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 21 Jul 2021 01:32:15 +1000 Subject: [PATCH] esp32/modmachine: Release the GIL in machine.idle(). So that other threads get a chance to run when taskYIELD() is called. See issue #5344. Signed-off-by: Damien George --- ports/esp32/modmachine.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/esp32/modmachine.c b/ports/esp32/modmachine.c index 50c0cff990..34fe8600ae 100644 --- a/ports/esp32/modmachine.c +++ b/ports/esp32/modmachine.c @@ -232,7 +232,9 @@ STATIC mp_obj_t machine_unique_id(void) { STATIC MP_DEFINE_CONST_FUN_OBJ_0(machine_unique_id_obj, machine_unique_id); STATIC mp_obj_t machine_idle(void) { + MP_THREAD_GIL_EXIT(); taskYIELD(); + MP_THREAD_GIL_ENTER(); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_0(machine_idle_obj, machine_idle);