函数 | |
_pthread_data * | pthread_get_self_data (void) |
_pthread_data * | pthread_get_data (pthread_t id) |
获取线程控制块 更多... | |
STATIC INT32 | CheckForCancel (VOID) |
STATIC VOID | ProcessUnusedStatusTask (_pthread_data *data) |
STATIC VOID | PthreadReap (VOID) |
STATIC VOID | SetPthreadAttr (const _pthread_data *self, const pthread_attr_t *attr, pthread_attr_t *outAttr) |
设置线程的属性 更多... | |
STATIC VOID | SetPthreadDataAttr (const pthread_attr_t *userAttr, const pthread_t threadID, LosTaskCB *taskCB, _pthread_data *created) |
STATIC UINT32 | InitPthreadData (pthread_t threadID, pthread_attr_t *userAttr, const CHAR name[], size_t len) |
线程控制块初始化 更多... | |
int | pthread_create (pthread_t *thread, const pthread_attr_t *attr, void *(*startRoutine)(void *), void *arg) |
pthread_create 创建线程 更多... | |
void | pthread_exit (void *retVal) |
线程退出 更多... | |
STATIC INT32 | ProcessByJoinState (_pthread_data *joined) |
int | pthread_join (pthread_t thread, void **retVal) |
int | pthread_detach (pthread_t thread) |
int | pthread_setschedparam (pthread_t thread, int policy, const struct sched_param *param) |
设置调度参数 更多... | |
int | pthread_getschedparam (pthread_t thread, int *policy, struct sched_param *param) |
int | pthread_once (pthread_once_t *onceControl, void(*initRoutine)(void)) |
int | pthread_key_create (pthread_key_t *key, void(*destructor)(void *)) |
int | pthread_setspecific (pthread_key_t key, const void *pointer) |
void * | pthread_getspecific (pthread_key_t key) |
int | pthread_setcancelstate (int state, int *oldState) |
int | pthread_setcanceltype (int type, int *oldType) |
STATIC UINT32 | DoPthreadCancel (_pthread_data *data) |
int | pthread_cancel (pthread_t thread) |
void | pthread_testcancel (void) |
pthread_t | pthread_self (void) |
int | pthread_equal (pthread_t thread1, pthread_t thread2) |
void | pthread_cleanup_push_inner (struct pthread_cleanup_buffer *buffer, void(*routine)(void *), void *arg) |
void | pthread_cleanup_pop_inner (struct pthread_cleanup_buffer *buffer, int execute) |
int | pthread_setaffinity_np (pthread_t thread, size_t cpusetsize, const cpu_set_t *cpuset) |
int | pthread_getaffinity_np (pthread_t thread, size_t cpusetsize, cpu_set_t *cpuset) |
变量 | |
STATIC _pthread_data | g_pthreadData [LOSCFG_BASE_CORE_TSK_LIMIT+1] |
STATIC INT32 | g_pthreadsExited = 0 |
STATIC pthread_mutex_t | g_pthreadsDataMutex = PTHREAD_MUTEX_INITIALIZER |
UINTPTR | g_pthreadCanceledDummyVar |
STATIC INT32 CheckForCancel | ( | VOID | ) |
STATIC UINT32 DoPthreadCancel | ( | _pthread_data * | data | ) |
STATIC UINT32 InitPthreadData | ( | pthread_t | threadID, |
pthread_attr_t * | userAttr, | ||
const CHAR | name[], | ||
size_t | len | ||
) |
线程控制块初始化
STATIC INT32 ProcessByJoinState | ( | _pthread_data * | joined | ) |
STATIC VOID ProcessUnusedStatusTask | ( | _pthread_data * | data | ) |
int pthread_cancel | ( | pthread_t | thread | ) |
int pthread_create | ( | pthread_t * | thread, |
const pthread_attr_t * | attr, | ||
void *(*)(void *) | startRoutine, | ||
void * | arg | ||
) |
pthread_create
创建线程
arg | 传递给线程入口函数的参数 |
attr | 指向线程属性的指针,如果使用 NULL,则使用默认的线程属性 |
startRoutine | 线程入口函数地址 |
thread | 指向线程句柄 (线程标识符) 的指针,不能为 NULL |
int pthread_detach | ( | pthread_t | thread | ) |
int pthread_equal | ( | pthread_t | thread1, |
pthread_t | thread2 | ||
) |
线程退出
_pthread_data * pthread_get_data | ( | pthread_t | id | ) |
获取线程控制块
_pthread_data * pthread_get_self_data | ( | void | ) |
void * pthread_getspecific | ( | pthread_key_t | key | ) |
pthread_t pthread_self | ( | void | ) |
设置调度参数
STATIC VOID PthreadReap | ( | VOID | ) |
STATIC VOID SetPthreadAttr | ( | const _pthread_data * | self, |
const pthread_attr_t * | attr, | ||
pthread_attr_t * | outAttr | ||
) |
设置线程的属性
STATIC VOID SetPthreadDataAttr | ( | const pthread_attr_t * | userAttr, |
const pthread_t | threadID, | ||
LosTaskCB * | taskCB, | ||
_pthread_data * | created | ||
) |
STATIC _pthread_data g_pthreadData[LOSCFG_BASE_CORE_TSK_LIMIT+1] |