1 /*
2 * Copyright (c) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved.
3 *
4 * UniProton is licensed under Mulan PSL v2.
5 * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 * You may obtain a copy of Mulan PSL v2 at:
7 * http://license.coscl.org.cn/MulanPSL2
8 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
9 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
10 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
11 * See the Mulan PSL v2 for more details.
12 * Create: 2022-11-15
13 * Description: pthread创建功能实现
14 */
15
16 #include "pthread.h"
17 #include "prt_posix_internal.h"
18
pthread_create(pthread_t * newthread,const pthread_attr_t * attr,void * (* threadroutine)(void *),void * arg)19 int pthread_create(pthread_t *newthread, const pthread_attr_t *attr, void *(*threadroutine)(void *), void *arg)
20 {
21 return PRT_PthreadCreate((TskHandle *)newthread, attr, threadroutine, arg);
22 }
23
pthread_exit(void * retval)24 void pthread_exit(void *retval)
25 {
26 PRT_PthreadExit(retval);
27 /* if PRT_PthreadExit is ok, never comes here */
28 while (1) {
29 }
30 }