From f038492dbcf7f165dbecfedba050876a2b95cb10 Mon Sep 17 00:00:00 2001 From: arvinzzz Date: Fri, 10 Feb 2023 17:42:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20pthread=5Fcreate=E5=86=85=E9=83=A8?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E6=97=B6=E5=BA=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在线程创建成功后,pthread_create内部先将函数返回值设置好,再进行TaskResume就绪调度状态 Signed-off-by: arvinzzz Change-Id: I795c115da612123b67f34cdc57e85eac955bbc08 --- kal/posix/src/pthread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kal/posix/src/pthread.c b/kal/posix/src/pthread.c index 154492ca..e365842e 100644 --- a/kal/posix/src/pthread.c +++ b/kal/posix/src/pthread.c @@ -221,10 +221,10 @@ int pthread_create(pthread_t *thread, const pthread_attr_t *attr, LOS_ListAdd(&g_pthreadListHead, &pthreadData->threadList); LOS_IntRestore(intSave); - (void)LOS_TaskResume(taskID); - *thread = (pthread_t)taskID; + (void)LOS_TaskResume(taskID); + return 0; }