summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--py/mpstate.h2
-rw-r--r--py/qstr.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/py/mpstate.h b/py/mpstate.h
index 9bb87f0ba..5f6cf5593 100644
--- a/py/mpstate.h
+++ b/py/mpstate.h
@@ -203,7 +203,7 @@ typedef struct _mp_state_vm_t {
size_t qstr_last_alloc;
size_t qstr_last_used;
- #if MICROPY_PY_THREAD
+ #if MICROPY_PY_THREAD && !MICROPY_PY_THREAD_GIL
// This is a global mutex used to make qstr interning thread-safe.
mp_thread_mutex_t qstr_mutex;
#endif
diff --git a/py/qstr.c b/py/qstr.c
index 29ffcae40..940d09ea4 100644
--- a/py/qstr.c
+++ b/py/qstr.c
@@ -125,7 +125,7 @@ void qstr_init(void) {
MP_STATE_VM(last_pool) = (qstr_pool_t*)&CONST_POOL; // we won't modify the const_pool since it has no allocated room left
MP_STATE_VM(qstr_last_chunk) = NULL;
- #if MICROPY_PY_THREAD
+ #if MICROPY_PY_THREAD && !MICROPY_PY_THREAD_GIL
mp_thread_mutex_init(&MP_STATE_VM(qstr_mutex));
#endif
}