* @brief Thread entry point stub that manages thread execution and resource cleanup * * This function serves as the entry point for POSIX threads, executing the thread's main * function and handling post-exit resource management based on the thread's detach state. * * @param parameter Thread parameter containing the _pthread_data_t structure pointer * * @note * - Executes thread's main f
| 326 | * - Integrates with pthread lifecycle management system for complete resource recovery |
| 327 | */ |
| 328 | static void pthread_entry_stub(void *parameter) |
| 329 | { |
| 330 | void *value; |
| 331 | _pthread_data_t *ptd; |
| 332 | |
| 333 | ptd = (_pthread_data_t *)parameter; |
| 334 | |
| 335 | /* execute pthread entry */ |
| 336 | value = ptd->thread_entry(ptd->thread_parameter); |
| 337 | |
| 338 | /* According to "detachstate" to whether or not to recycle resource immediately */ |
| 339 | if (ptd->attr.detachstate == PTHREAD_CREATE_JOINABLE) |
| 340 | { |
| 341 | /* set value */ |
| 342 | ptd->return_value = value; |
| 343 | rt_sem_release(ptd->joinable_sem); |
| 344 | } |
| 345 | else |
| 346 | { |
| 347 | /* release pthread resource */ |
| 348 | _pthread_data_destroy(ptd); |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | /** |
| 353 | * @brief Creates a new thread in a POSIX-compliant system. |
nothing calls this directly
no test coverage detected