diff options
author | Damien George <damien.p.george@gmail.com> | 2016-05-26 10:42:53 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-06-28 11:28:50 +0100 |
commit | 4cec63a9dbed86c4332b9e7fcd56d092046193e4 (patch) | |
tree | 9e5e0636411f5de6647d4021c8069a39cb031f14 /py/mpconfig.h | |
parent | 1f54ad2aed0dc8f2d868ccd89ccf639a475e8022 (diff) |
py: Implement a simple global interpreter lock.
This makes the VM/runtime thread safe, at the cost of not being able to
run code in parallel.
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r-- | py/mpconfig.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h index 998d1b692..b79ddac19 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -829,6 +829,12 @@ typedef double mp_float_t; #define MICROPY_PY_THREAD (0) #endif +// Whether to make the VM/runtime thread-safe using a global lock +// If not enabled then thread safety must be provided at the Python level +#ifndef MICROPY_PY_THREAD_GIL +#define MICROPY_PY_THREAD_GIL (MICROPY_PY_THREAD) +#endif + // Extended modules #ifndef MICROPY_PY_UCTYPES |