diff options
Diffstat (limited to 'py/modthread.c')
-rw-r--r-- | py/modthread.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/py/modthread.c b/py/modthread.c index 51d63e470..6b7547490 100644 --- a/py/modthread.c +++ b/py/modthread.c @@ -129,7 +129,7 @@ STATIC MP_DEFINE_CONST_OBJ_TYPE( STATIC size_t thread_stack_size = 0; STATIC mp_obj_t mod_thread_get_ident(void) { - return mp_obj_new_int_from_uint((uintptr_t)mp_thread_get_state()); + return mp_obj_new_int_from_uint(mp_thread_get_id()); } STATIC MP_DEFINE_CONST_FUN_OBJ_0(mod_thread_get_ident_obj, mod_thread_get_ident); @@ -268,9 +268,7 @@ STATIC mp_obj_t mod_thread_start_new_thread(size_t n_args, const mp_obj_t *args) th_args->fun = args[0]; // spawn the thread! - mp_thread_create(thread_entry, th_args, &th_args->stack_size); - - return mp_const_none; + return mp_obj_new_int_from_uint(mp_thread_create(thread_entry, th_args, &th_args->stack_size)); } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_thread_start_new_thread_obj, 2, 3, mod_thread_start_new_thread); |