Lines Matching refs:pthread
134 static void pthread_delete(esp_pthread_t *pthread) in pthread_delete() argument
136 SLIST_REMOVE(&s_threads_list, pthread, esp_pthread_entry, list_node); in pthread_delete()
137 free(pthread); in pthread_delete()
229 esp_pthread_t *pthread = calloc(1, sizeof(esp_pthread_t)); in pthread_create() local
230 if (pthread == NULL) { in pthread_create()
277 pthread->detached = true; in pthread_create()
281 pthread->detached = false; in pthread_create()
287 pthread->task_arg = task_arg; in pthread_create()
302 free(pthread); in pthread_create()
310 pthread->handle = xHandle; in pthread_create()
315 SLIST_INSERT_HEAD(&s_threads_list, pthread, list_node); in pthread_create()
321 *thread = (pthread_t)pthread; // pointer value fit into pthread_t (uint32_t) in pthread_create()
330 esp_pthread_t *pthread = (esp_pthread_t *)thread; in pthread_join() local
335 ESP_LOGV(TAG, "%s %p", __FUNCTION__, pthread); in pthread_join()
345 } else if (pthread->detached) { in pthread_join()
348 } else if (pthread->join_task) { in pthread_join()
360 if (pthread->state == PTHREAD_TASK_STATE_RUN) { in pthread_join()
361 pthread->join_task = xTaskGetCurrentTaskHandle(); in pthread_join()
364 child_task_retval = pthread->retval; in pthread_join()
365 pthread_delete(pthread); in pthread_join()
377 child_task_retval = pthread->retval; in pthread_join()
378 pthread_delete(pthread); in pthread_join()
388 ESP_LOGV(TAG, "%s %p EXIT %d", __FUNCTION__, pthread, ret); in pthread_join()
394 esp_pthread_t *pthread = (esp_pthread_t *)thread; in pthread_detach() local
403 } else if (pthread->detached) { in pthread_detach()
406 } else if (pthread->join_task) { in pthread_detach()
409 } else if (pthread->state == PTHREAD_TASK_STATE_RUN) { in pthread_detach()
411 pthread->detached = true; in pthread_detach()
414 pthread_delete(pthread); in pthread_detach()
418 ESP_LOGV(TAG, "%s %p EXIT %d", __FUNCTION__, pthread, ret); in pthread_detach()
432 esp_pthread_t *pthread = pthread_find(xTaskGetCurrentTaskHandle()); in pthread_exit() local
433 if (!pthread) { in pthread_exit()
436 if (pthread->task_arg) { in pthread_exit()
437 free(pthread->task_arg); in pthread_exit()
439 if (pthread->detached) { in pthread_exit()
441 pthread_delete(pthread); in pthread_exit()
445 pthread->retval = value_ptr; in pthread_exit()
447 if (pthread->join_task) { in pthread_exit()
449 xTaskNotify(pthread->join_task, 0, eNoAction); in pthread_exit()
451 pthread->state = PTHREAD_TASK_STATE_EXIT; in pthread_exit()
485 esp_pthread_t *pthread = pthread_find(xTaskGetCurrentTaskHandle()); in pthread_self() local
486 if (!pthread) { in pthread_self()
490 return (pthread_t)pthread; in pthread_self()