• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 key功能实现
14  */
15 #include "pthread.h"
16 #include "prt_posix_internal.h"
17 
pthread_key_create(pthread_key_t * key,void (* destructor)(void *))18 int pthread_key_create(pthread_key_t *key, void (*destructor)(void *))
19 {
20     return PRT_PthreadKeyCreate(key, destructor);
21 }
22 
pthread_key_delete(pthread_key_t key)23 int pthread_key_delete(pthread_key_t key)
24 {
25     return PRT_PthreadKeyDelete(key);
26 }
27 
pthread_setspecific(pthread_key_t key,const void * value)28 int pthread_setspecific(pthread_key_t key, const void *value)
29 {
30     return PRT_PthreadSetSpecific(key, value);
31 }
32 
pthread_getspecific(pthread_key_t key)33 void *pthread_getspecific(pthread_key_t key)
34 {
35     return PRT_PthreadGetSpecific(key);
36 }