Xilkernel pthread_join func equivalent in freertos

Hi,

is there a way to freeze the exec of a thread until termination of a certain thread. actually I want a xilkernel pthread_join func equivalent in freertos.

I appreciate your help.

As far as I know, there is no equivalent to a *nix ‘join’ operation in FreeRTOS, as there is no automatic event created when a task terminates. you could have the task as its last operation set some event somewhere, the the joiner could wait on, but that would not delay until the ending task is really dead.

My first thought is that such an operation isn’t really common for FreeRTOS applications. FreeRTOS is NOT Linux, and FreeRTOS machines are not like those you typically run Linux on. In Linux this sort of operation is common when you spin up a group of threads to spread a calculation across multiple cores, but FreeRTOS is aimed at single core machines so that isn’t as useful (There are some unofficial SMP ports, but a number of things need to change to support that sort of environment).

I find that I rarely actually have a thread terminate, so I wouldn’t find it that useful. I do understand that some applications might want to spin up additional worker threads for some requests at time, but I can’t really see where a typical FreeRTOS task would want to wait for another Task to finish.

Have you looked at xEventGroupSync()?

It’s not exactly what you’re looking for, but might be useful.