aboutsummaryrefslogtreecommitdiff
path: root/cc3200/util/gccollect.c
diff options
context:
space:
mode:
authorDamien George2016-05-27 17:35:46 +0100
committerDamien George2016-06-28 11:28:51 +0100
commiteef4f13a3390dc88902563acb047f0439eff0caf (patch)
treebee965a953a984a8503cee3f57ceaba1b1f1bf39 /cc3200/util/gccollect.c
parent9b1c1262dc70cfb6b5cf5d27e3e3d8e41b5a4901 (diff)
cc3200: Add basic threading capabilities.
Can create a new thread and run it. Does not use the GIL at this point.
Diffstat (limited to 'cc3200/util/gccollect.c')
-rw-r--r--cc3200/util/gccollect.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cc3200/util/gccollect.c b/cc3200/util/gccollect.c
index 094ca73bc..bc9cba4b8 100644
--- a/cc3200/util/gccollect.c
+++ b/cc3200/util/gccollect.c
@@ -30,6 +30,7 @@
#include "py/mpconfig.h"
#include "py/gc.h"
+#include "py/mpthread.h"
#include "gccollect.h"
#include "gchelper.h"
@@ -57,6 +58,11 @@ void gc_collect(void) {
// trace the stack, including the registers (since they live on the stack in this function)
gc_collect_root((void**)sp, (stackend - sp) / sizeof(uint32_t));
+ // trace root pointers from any threads
+ #if MICROPY_PY_THREAD
+ mp_thread_gc_others();
+ #endif
+
// end the GC
gc_collect_end();
}