From 864fa716f4f0b66a9b3f26cc6d0eeed08a3bb43e Mon Sep 17 00:00:00 2001 From: Hubert Badocha Date: Thu, 19 Oct 2023 12:53:25 +0200 Subject: [PATCH] phtread: call pthread_exit implicitely on return from start function JIRA: RTOS-634 --- pthread/pthread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pthread/pthread.c b/pthread/pthread.c index 88d0a63b..53bacf17 100644 --- a/pthread/pthread.c +++ b/pthread/pthread.c @@ -127,9 +127,9 @@ static void start_point(void *args) _errno_new(&ctx->e); - ctx->retval = (void *)(ctx->start_routine(ctx->arg)); + void *retval = (void *)(ctx->start_routine(ctx->arg)); - endthread(); + pthread_exit(retval); }