summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--py/gc.c2
-rw-r--r--py/mpstate.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/py/gc.c b/py/gc.c
index c763a839e..c18cd429f 100644
--- a/py/gc.c
+++ b/py/gc.c
@@ -161,7 +161,7 @@ void gc_init(void *start, void *end) {
MP_STATE_MEM(gc_alloc_amount) = 0;
#endif
- #if MICROPY_PY_THREAD
+ #if MICROPY_PY_THREAD && !MICROPY_PY_THREAD_GIL
mp_thread_mutex_init(&MP_STATE_MEM(gc_mutex));
#endif
diff --git a/py/mpstate.h b/py/mpstate.h
index ab7d8c51b..9bb87f0ba 100644
--- a/py/mpstate.h
+++ b/py/mpstate.h
@@ -98,7 +98,7 @@ typedef struct _mp_state_mem_t {
size_t gc_collected;
#endif
- #if MICROPY_PY_THREAD
+ #if MICROPY_PY_THREAD && !MICROPY_PY_THREAD_GIL
// This is a global mutex used to make the GC thread-safe.
mp_thread_mutex_t gc_mutex;
#endif