summaryrefslogtreecommitdiffstatshomepage
path: root/py/mpthread.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-04-25 15:28:57 +0000
committerDamien George <damien.p.george@gmail.com>2016-06-28 11:28:49 +0100
commitc93d9caa8b8be81f7e6faf9f2ca2ad16d4942ab8 (patch)
tree8bc6f5fd0363d3f7135d1e47d0ba13a5cf7c9a6d /py/mpthread.h
parent34fc006f5e75f064f3aad9ccc98963dc2fa01e25 (diff)
downloadmicropython-c93d9caa8b8be81f7e6faf9f2ca2ad16d4942ab8.tar.gz
micropython-c93d9caa8b8be81f7e6faf9f2ca2ad16d4942ab8.zip
py/gc: Make memory manager and garbage collector thread safe.
By using a single, global mutex, all memory-related functions (alloc, free, realloc, collect, etc) are made thread safe. This means that only one thread can be in such a function at any one time.
Diffstat (limited to 'py/mpthread.h')
-rw-r--r--py/mpthread.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/py/mpthread.h b/py/mpthread.h
index 498380a5e1..a92f2d0797 100644
--- a/py/mpthread.h
+++ b/py/mpthread.h
@@ -36,7 +36,9 @@
#include <mpthreadport.h>
#endif
-mp_state_thread_t *mp_thread_get_state(void);
+struct _mp_state_thread_t;
+
+struct _mp_state_thread_t *mp_thread_get_state(void);
void mp_thread_set_state(void *state);
void mp_thread_create(void *(*entry)(void*), void *arg, size_t stack_size);
void mp_thread_mutex_init(mp_thread_mutex_t *mutex);