diff --git a/py/gc.c b/py/gc.c index 86ed0ce30ef5c9edf348bd7c52fa87a5e678ac89..1fd3206022f7a21a7102a4f0ea1959e8d7e30ac6 100644 --- a/py/gc.c +++ b/py/gc.c @@ -94,7 +94,7 @@ #define FTB_CLEAR(block) do { MP_STATE_MEM(gc_finaliser_table_start)[(block) / BLOCKS_PER_FTB] &= (~(1 << ((block) & 7))); } while (0) #endif -#if MICROPY_PY_THREAD +#if MICROPY_PY_THREAD && !MICROPY_PY_THREAD_GIL #define GC_ENTER() mp_thread_mutex_lock(&MP_STATE_MEM(gc_mutex), 1) #define GC_EXIT() mp_thread_mutex_unlock(&MP_STATE_MEM(gc_mutex)) #else diff --git a/py/qstr.c b/py/qstr.c index 39eb696c78fda92b797ade49536d1658ed77f844..079b2a8e7eb238a846e6974f2b95855aeff1fc16 100644 --- a/py/qstr.c +++ b/py/qstr.c @@ -72,7 +72,7 @@ #error unimplemented qstr length decoding #endif -#if MICROPY_PY_THREAD +#if MICROPY_PY_THREAD && !MICROPY_PY_THREAD_GIL #define QSTR_ENTER() mp_thread_mutex_lock(&MP_STATE_VM(qstr_mutex), 1) #define QSTR_EXIT() mp_thread_mutex_unlock(&MP_STATE_VM(qstr_mutex)) #else