diff options
author | Damien George <damien.p.george@gmail.com> | 2016-05-26 09:06:46 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-06-28 11:28:50 +0100 |
commit | 1f54ad2aed0dc8f2d868ccd89ccf639a475e8022 (patch) | |
tree | 101ef4b66e198a1d5708890567ab3ab4501c9201 /py/mpstate.h | |
parent | b7274e91bc2fe6a8059ce7e65e02c20d000322b1 (diff) |
py: Make interning of qstrs thread safe.
Diffstat (limited to 'py/mpstate.h')
-rw-r--r-- | py/mpstate.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/py/mpstate.h b/py/mpstate.h index f1f8fd9c5..3ee243dff 100644 --- a/py/mpstate.h +++ b/py/mpstate.h @@ -164,6 +164,11 @@ typedef struct _mp_state_vm_t { 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 |