Lines Matching refs:tid

57 	struct cv2_thread *tid = arg2;  in zephyr_thread_wrapper()  local
62 tid->has_joined = TRUE; in zephyr_thread_wrapper()
63 k_sem_give(&tid->join_guard); in zephyr_thread_wrapper()
82 osThreadId_t get_cmsis_thread_id(k_tid_t tid) in get_cmsis_thread_id() argument
87 if (tid != NULL) { in get_cmsis_thread_id()
91 if (&itr->z_thread == tid) { in get_cmsis_thread_id()
108 struct cv2_thread *tid; in osThreadNew() local
164 tid = &cv2_thread_pool[this_thread_num]; in osThreadNew()
165 tid->attr_bits = attr->attr_bits; in osThreadNew()
183 k_poll_signal_init(&tid->poll_signal); in osThreadNew()
184 k_poll_event_init(&tid->poll_event, K_POLL_TYPE_SIGNAL, in osThreadNew()
185 K_POLL_MODE_NOTIFY_ONLY, &tid->poll_signal); in osThreadNew()
186 tid->signal_results = 0U; in osThreadNew()
194 sys_dlist_append(&thread_list, &tid->node); in osThreadNew()
196 k_sem_init(&tid->join_guard, 0, 1); in osThreadNew()
197 tid->has_joined = FALSE; in osThreadNew()
199 (void)k_thread_create(&tid->z_thread, in osThreadNew()
202 (void *)arg, tid, threadfunc, in osThreadNew()
206 strncpy(tid->name, init_thread_attrs.name, in osThreadNew()
207 sizeof(tid->name) - 1); in osThreadNew()
209 strncpy(tid->name, attr->name, sizeof(tid->name) - 1); in osThreadNew()
212 k_thread_name_set(&tid->z_thread, tid->name); in osThreadNew()
214 return (osThreadId_t)tid; in osThreadNew()
230 struct cv2_thread *tid = in osThreadGetName() local
233 name = k_thread_name_get(&tid->z_thread); in osThreadGetName()
245 k_tid_t tid = k_current_get(); in osThreadGetId() local
247 return get_cmsis_thread_id(tid); in osThreadGetId()
255 struct cv2_thread *tid = (struct cv2_thread *)thread_id; in osThreadGetPriority() local
258 if (k_is_in_isr() || (tid == NULL) || in osThreadGetPriority()
259 (is_cmsis_rtos_v2_thread(tid) == NULL) || in osThreadGetPriority()
260 (_is_thread_cmsis_inactive(&tid->z_thread))) { in osThreadGetPriority()
264 priority = k_thread_priority_get(&tid->z_thread); in osThreadGetPriority()
273 struct cv2_thread *tid = (struct cv2_thread *)thread_id; in osThreadSetPriority() local
275 if ((tid == NULL) || (is_cmsis_rtos_v2_thread(tid) == NULL) || in osThreadSetPriority()
284 if (_is_thread_cmsis_inactive(&tid->z_thread)) { in osThreadSetPriority()
288 k_thread_priority_set((k_tid_t)&tid->z_thread, in osThreadSetPriority()
299 struct cv2_thread *tid = (struct cv2_thread *)thread_id; in osThreadGetState() local
302 if (k_is_in_isr() || (tid == NULL) || in osThreadGetState()
303 (is_cmsis_rtos_v2_thread(tid) == NULL)) { in osThreadGetState()
307 switch (tid->z_thread.base.thread_state) { in osThreadGetState()
352 struct cv2_thread *tid = (struct cv2_thread *)thread_id; in osThreadGetStackSize() local
354 __ASSERT(tid, ""); in osThreadGetStackSize()
355 __ASSERT(is_cmsis_rtos_v2_thread(tid), ""); in osThreadGetStackSize()
358 return tid->z_thread.stack_info.size; in osThreadGetStackSize()
367 struct cv2_thread *tid = (struct cv2_thread *)thread_id; in osThreadGetStackSpace() local
371 __ASSERT(tid, ""); in osThreadGetStackSpace()
372 __ASSERT(is_cmsis_rtos_v2_thread(tid), ""); in osThreadGetStackSpace()
375 ret = k_thread_stack_space_get(&tid->z_thread, &unused); in osThreadGetStackSpace()
388 struct cv2_thread *tid = (struct cv2_thread *)thread_id; in osThreadSuspend() local
390 if ((tid == NULL) || (is_cmsis_rtos_v2_thread(tid) == NULL)) { in osThreadSuspend()
398 if (_is_thread_cmsis_inactive(&tid->z_thread)) { in osThreadSuspend()
402 k_thread_suspend(&tid->z_thread); in osThreadSuspend()
412 struct cv2_thread *tid = (struct cv2_thread *)thread_id; in osThreadResume() local
414 if ((tid == NULL) || (is_cmsis_rtos_v2_thread(tid) == NULL)) { in osThreadResume()
422 if (_is_thread_cmsis_inactive(&tid->z_thread)) { in osThreadResume()
426 k_thread_resume(&tid->z_thread); in osThreadResume()
437 struct cv2_thread *tid = (struct cv2_thread *)thread_id; in osThreadDetach() local
439 if ((tid == NULL) || (is_cmsis_rtos_v2_thread(tid) == NULL)) { in osThreadDetach()
447 if (_is_thread_cmsis_inactive(&tid->z_thread)) { in osThreadDetach()
451 __ASSERT(tid->attr_bits != osThreadDetached, in osThreadDetach()
454 tid->attr_bits = osThreadDetached; in osThreadDetach()
456 k_sem_give(&tid->join_guard); in osThreadDetach()
466 struct cv2_thread *tid = (struct cv2_thread *)thread_id; in osThreadJoin() local
469 if ((tid == NULL) || (is_cmsis_rtos_v2_thread(tid) == NULL)) { in osThreadJoin()
477 if (_is_thread_cmsis_inactive(&tid->z_thread)) { in osThreadJoin()
481 if (tid->attr_bits != osThreadJoinable) { in osThreadJoin()
485 if (!tid->has_joined) { in osThreadJoin()
486 if (k_sem_take(&tid->join_guard, K_FOREVER) != 0) { in osThreadJoin()
490 k_sem_give(&tid->join_guard); in osThreadJoin()
493 if (tid->has_joined && (tid->attr_bits == osThreadJoinable)) { in osThreadJoin()
507 struct cv2_thread *tid; in osThreadExit() local
510 tid = osThreadGetId(); in osThreadExit()
512 k_sem_give(&tid->join_guard); in osThreadExit()
514 k_thread_abort((k_tid_t)&tid->z_thread); in osThreadExit()
524 struct cv2_thread *tid = (struct cv2_thread *)thread_id; in osThreadTerminate() local
526 if ((tid == NULL) || (is_cmsis_rtos_v2_thread(tid) == NULL)) { in osThreadTerminate()
534 if (_is_thread_cmsis_inactive(&tid->z_thread)) { in osThreadTerminate()
538 k_sem_give(&tid->join_guard); in osThreadTerminate()
540 k_thread_abort((k_tid_t)&tid->z_thread); in osThreadTerminate()
570 osThreadId_t tid; in osThreadEnumerate() local
581 tid = get_cmsis_thread_id(thread); in osThreadEnumerate()
582 if (tid != NULL) { in osThreadEnumerate()
583 thread_array[count] = tid; in osThreadEnumerate()