summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-05-26 10:53:34 +0000
committerDamien George <damien.p.george@gmail.com>2016-06-28 11:28:50 +0100
commita1c93a62b1d1020c5ef3ce1744469a118433d0e5 (patch)
tree1c03b8e373477e46581a046b8c7dede182d6fbaa
parent4cec63a9dbed86c4332b9e7fcd56d092046193e4 (diff)
downloadmicropython-a1c93a62b1d1020c5ef3ce1744469a118433d0e5.tar.gz
micropython-a1c93a62b1d1020c5ef3ce1744469a118433d0e5.zip
py: Don't use gc or qstr mutex when the GIL is enabled.
There is no need since the GIL already makes gc and qstr operations atomic.
-rw-r--r--py/gc.c2
-rw-r--r--py/qstr.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/py/gc.c b/py/gc.c
index 86ed0ce30e..1fd3206022 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 39eb696c78..079b2a8e7e 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