From 4cd47453aea0c31e43ff8e0ab14cce8fc4c70ea2 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Wed, 4 Dec 2019 13:44:57 +0900 Subject: [PATCH] Fix GNU/Linux emulation about termination of a thread. Signed-off-by: NIIBE Yutaka --- ChangeLog | 4 ++++ chopstx-gnu-linux.c | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 032d590..f56726e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2019-12-04 NIIBE Yutaka + + * chopstx-gnu-linux.c (chx_thread_start): Fix return value. + 2019-11-21 NIIBE Yutaka * chopstx-cortex-m.c (chx_set_running): New. diff --git a/chopstx-gnu-linux.c b/chopstx-gnu-linux.c index a0fa510..3f47c69 100644 --- a/chopstx-gnu-linux.c +++ b/chopstx-gnu-linux.c @@ -328,9 +328,11 @@ chx_sched (uint32_t yield) static void __attribute__((__noreturn__)) chx_thread_start (voidfunc thread_entry, void *arg) { + void *ret; + chx_cpu_sched_unlock (); - thread_entry (arg); - chopstx_exit (0); + ret = thread_entry (arg); + chopstx_exit (ret); } static struct chx_thread *