Hi,
I am working on Murata1LD board in Wiced-Studio. I need to delete a thread in the application. From the Wiced-APIs the function to delete a thread is
wiced_result_t wiced_rtos_delete_thread(wiced_thread_t *thread). The explanation says this function deletes a terminated thread. Can you please make it clear how to terminate a thread?
Thanks,
Binsy M S
Solved! Go to Solution.
Hi,
Yes, you are right. The API to delete a thread is wiced_rtos_delete_thread. It deletes a terminated thread.
You can terminate a thread in three ways:
1. If the thread returns from it's start routine.
2. If it is canceled by some other thread.
3. If it calls pthread_exit() function from within itself. (POSIX thread library is not supported within WICED)
I have attached a sample program to terminate a thread after it's execution get completed. You can also see the terminal snapshot for the UART prints. I have attached two snapshots of the Debug window. One of them shows the thread status before the API call (wiced_rtos_delete_thread) . It shows the status of the thread application thread as "Completed". The other snapshot shows the thread status after the API call. You will see that the thread is deleted.
Thanks
Hi,
Yes, you are right. The API to delete a thread is wiced_rtos_delete_thread. It deletes a terminated thread.
You can terminate a thread in three ways:
1. If the thread returns from it's start routine.
2. If it is canceled by some other thread.
3. If it calls pthread_exit() function from within itself. (POSIX thread library is not supported within WICED)
I have attached a sample program to terminate a thread after it's execution get completed. You can also see the terminal snapshot for the UART prints. I have attached two snapshots of the Debug window. One of them shows the thread status before the API call (wiced_rtos_delete_thread) . It shows the status of the thread application thread as "Completed". The other snapshot shows the thread status after the API call. You will see that the thread is deleted.
Thanks