summaryrefslogtreecommitdiff
path: root/py/modthread.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-05-04 09:52:19 +0000
committerDamien George <damien.p.george@gmail.com>2016-06-28 11:28:49 +0100
commit9172c0cb252faa47f56e61f67ceb213012631de2 (patch)
tree71b9a84fb456ec2a85994cb9f1851baf0bee424e /py/modthread.c
parent722cff5fd0debb250af827fd556dc0cab94e07d7 (diff)
py/modthread: Call mp_thread_start/mp_thread_finish around threads.
So the underlying thread implementation can do any necessary bookkeeping.
Diffstat (limited to 'py/modthread.c')
-rw-r--r--py/modthread.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/py/modthread.c b/py/modthread.c
index 4e654dfe8..930ca45bb 100644
--- a/py/modthread.c
+++ b/py/modthread.c
@@ -154,6 +154,9 @@ STATIC void *thread_entry(void *args_in) {
mp_stack_set_top(&ts + 1); // need to include ts in root-pointer scan
mp_stack_set_limit(16 * 1024); // fixed stack limit for now
+ // signal that we are set up and running
+ mp_thread_start();
+
// TODO set more thread-specific state here:
// mp_pending_exception? (root pointer)
// cur_exception (root pointer)
@@ -182,6 +185,9 @@ STATIC void *thread_entry(void *args_in) {
DEBUG_printf("[thread] finish ts=%p\n", &ts);
+ // signal that we are finished
+ mp_thread_finish();
+
return NULL;
}