All content and materials on this
site are provided "as is". TI and its respective suppliers and providers of content make no representations about
the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these
materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a
particular purpose, title and non-infringement of any third party intellectual property right. No license, either
express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a
license from a third party, or a license from TI.
On FreeRTOS, when calling pthread_create(), the first argument is a pointer to the thread handle. Before the new thread starts running, it must store the new pthread handle in this location. However, the scheduler is started before the handle is stored. This causes the calling thread to be preempted (the thread which called pthread_create()), and the new thread starts running. If the new thread references the thread handle, it will be uninitialized.
On FreeRTOS, when calling pthread_create(), the first argument is a pointer to the thread handle. Before the new thread starts running, it must store the new pthread handle in this location. However, the scheduler is started before the handle is stored. This causes the calling thread to be preempted (the thread which called pthread_create()), and the new thread starts running. If the new thread references the thread handle, it will be uninitialized.
Thread handle set too late in pthread_create() [FreeRTOS]