summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2021-07-21 01:32:15 +1000
committerDamien George <damien@micropython.org>2021-07-22 00:17:59 +1000
commit2cfbe5bc0fe2c8ed24c6f35abbc82ef8415d17e4 (patch)
tree6fcdfdbee8fc7e186f430278560d22d6fc68d461
parent6bc50c4fa9da1d97f1ff14b1331d8d497962ed17 (diff)
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 <damien@micropython.org>
-rw-r--r--ports/esp32/modmachine.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ports/esp32/modmachine.c b/ports/esp32/modmachine.c
index 50c0cff99..34fe8600a 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);