Ouss4 commented on PR #6197: URL: https://github.com/apache/incubator-nuttx/pull/6197#issuecomment-1122154409
> Does someone know what this snippet in `arch/risc-v/src/esp32c3/esp32c3_wifi_adapter.c` should do, people on espressif / anyone ? Blame points to @donghengqaz: > > ``` > > static void *esp_thread_semphr_get(void) > { > int ret; > int i; > void *sem; > struct tcb_s *tcb = this_task(); > struct task_group_s *group = tcb->group; > > for (i = 0; i < CONFIG_SCHED_EXIT_MAX; i++) > { > if (group->tg_exit[i].func.on == esp_thread_semphr_free) > { > break; > } > } > > if (i >= CONFIG_SCHED_EXIT_MAX) > { > sem = esp_semphr_create(1, 0); > if (!sem) > { > wlerr("ERROR: Failed to create semaphore\n"); > return NULL; > } > > ret = on_exit(esp_thread_semphr_free, sem); > if (ret < 0) > { > wlerr("ERROR: Failed to bind semaphore\n"); > esp_semphr_delete(sem); > return NULL; > } > } > else > { > sem = group->tg_exit[i].arg; > } > > return sem; > } > ``` > > How about @gustavonihei do you know what this does ? The group->tg_exit[i].func.on list will be removed and `esp_thread_semphr_get` will require another solution. Any ideas ? @pussuw I think we can move that one to use pthread specific data as in ESP32, I am not sure why it was implemented this way for ESP32-C3. We'll do some tests with this change. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org