Lines Matching defs:thread
84 static inline bool IsPthread(pthread_t thread)
87 if ((UINT32)thread > LOSCFG_BASE_CORE_TSK_LIMIT) {
90 tcb = OS_TCB_FROM_TID((UINT32)thread);
177 pthread_t thread = pthread_self();
178 if (!IsPthread(thread)) {
179 PRINT_ERR("[%s:%d] This task %lu is not a posix thread!!!\n", __FUNCTION__, __LINE__, thread);
183 tcb = OS_TCB_FROM_TID((UINT32)thread);
194 int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
202 if ((thread == NULL) || (startRoutine == NULL)) {
226 *thread = (pthread_t)taskID;
233 int pthread_setschedparam(pthread_t thread, int policy, const struct sched_param *param)
235 if (!IsPthread(thread)) {
236 PRINT_ERR("[%s:%d] This task %lu is not a posix thread!!!\n", __FUNCTION__, __LINE__, thread);
250 if (LOS_TaskPriSet((UINT32)thread, (UINT16)param->sched_priority) != LOS_OK) {
257 int pthread_setschedprio(pthread_t thread, int prio)
259 if (!IsPthread(thread)) {
260 PRINT_ERR("[%s:%d] This task %lu is not a posix thread!!!\n", __FUNCTION__, __LINE__, thread);
264 if (LOS_TaskPriSet((UINT32)thread, (UINT16)prio) != LOS_OK) {
276 pthread_t thread = pthread_self();
277 if (!IsPthread(thread)) {
278 PRINT_ERR("[%s:%d] This task %lu is not a posix thread!!!\n", __FUNCTION__, __LINE__, thread);
307 pthread_t thread = pthread_self();
308 if (!IsPthread(thread)) {
309 PRINT_ERR("[%s:%d] This task %lu is not a posix thread!!!\n", __FUNCTION__, __LINE__, thread);
317 tcb = OS_TCB_FROM_TID((UINT32)thread);
340 pthread_t thread = pthread_self();
341 if (!IsPthread(thread)) {
342 PRINT_ERR("[%s:%d] This task %lu is not a posix thread!!!\n", __FUNCTION__, __LINE__, thread);
350 tcb = OS_TCB_FROM_TID((UINT32)thread);
368 int pthread_getschedparam(pthread_t thread, int *policy, struct sched_param *param)
372 if (!IsPthread(thread)) {
373 PRINT_ERR("[%s:%d] This task %lu is not a posix thread!!!\n", __FUNCTION__, __LINE__, thread);
381 prio = LOS_TaskPriGet((UINT32)thread);
418 int pthread_cancel(pthread_t thread)
423 if (!IsPthread(thread)) {
424 PRINT_ERR("[%s:%d] This task %lu is not a posix thread!!!\n", __FUNCTION__, __LINE__, thread);
428 tcb = OS_TCB_FROM_TID((UINT32)thread);
434 * If the thread has cancellation enabled, and it is in
435 * asynchronous mode, suspend it and set corresponding thread's status.
436 * We also release the thread out of any current wait to make it wake up.
461 int pthread_join(pthread_t thread, void **retval)
465 if (!IsPthread(thread)) {
466 PRINT_ERR("[%s:%d] This task %lu is not a posix thread!!!\n", __FUNCTION__, __LINE__, thread);
470 ret = LOS_TaskJoin((UINT32)thread, &result);
489 int pthread_detach(pthread_t thread)
492 if (!IsPthread(thread)) {
493 PRINT_ERR("[%s:%d] This task %lu is not a posix thread!!!\n", __FUNCTION__, __LINE__, thread);
497 ret = LOS_TaskDetach((UINT32)thread);
513 pthread_t thread = pthread_self();
514 if (!IsPthread(thread)) {
515 PRINT_ERR("[%s:%d] This task %lu is not a posix thread!!!\n", __FUNCTION__, __LINE__, thread);
519 tcb = OS_TCB_FROM_TID((UINT32)thread);
541 int pthread_setname_np(pthread_t thread, const char *name)
547 if (!IsPthread(thread)) {
548 PRINT_ERR("[%s:%d] This task %lu is not a posix thread!!!\n", __FUNCTION__, __LINE__, thread);
552 taskName = LOS_TaskNameGet((UINT32)thread);
561 taskCB = OS_TCB_FROM_TID((UINT32)thread);
579 int pthread_getname_np(pthread_t thread, char *buf, size_t buflen)
584 if (!IsPthread(thread)) {
585 PRINT_ERR("[%s:%d] This task %lu is not a posix thread!!!\n", __FUNCTION__, __LINE__, thread);
589 name = LOS_TaskNameGet((UINT32)thread);
634 pthread_t thread = pthread_self();
635 if (!IsPthread(thread)) {
636 PRINT_ERR("[%s:%d] This task %lu is not a posix thread!!!\n", __FUNCTION__, __LINE__, thread);
672 pthread_t thread = pthread_self();
673 if (!IsPthread(thread)) {
674 PRINT_ERR("[%s:%d] This task %lu is not a posix thread!!!\n", __FUNCTION__, __LINE__, thread);
715 PRINT_ERR("[%s:%d] This task %lu is not a posix thread!!!\n", __FUNCTION__, __LINE__, self);
756 PRINT_ERR("[%s:%d] This task %lu is not a posix thread!!!\n", __FUNCTION__, __LINE__, self);