py: Make interning of qstrs thread safe.
diff --git a/py/mpstate.h b/py/mpstate.h
index f1f8fd9..3ee243d 100644
--- a/py/mpstate.h
+++ b/py/mpstate.h
@@ -164,6 +164,11 @@
     size_t qstr_last_alloc;
     size_t qstr_last_used;
 
+    #if MICROPY_PY_THREAD
+    // This is a global mutex used to make qstr interning thread-safe.
+    mp_thread_mutex_t qstr_mutex;
+    #endif
+
     mp_uint_t mp_optimise_value;
 
     // size of the emergency exception buf, if it's dynamically allocated