7 years ago.

(void const *args) where can I find documentation on what gets passed to a thread?

title says it.

Thank you!

1 Answer

7 years ago.

See for example the mutex section here: https://mbed.org/handbook/RTOS

a void const *arg is a pointer of not a specific type. So when making the thread you need to give it a pointer, and convert that pointer to a void pointer, and in the thread itself convert it back to whatever you want it to be.

Accepted Answer

Great, so its a lot like vargs, I just need to manage the pointer and data myself?

posted by Andrew Miller 29 Jul 2014

Yep indeed. Although it is only required if you want to make several threads of the same type, but with different arguments.

Generally I guess easiest way is to make a struct with whatever you need, and give it a pointer to that struct.

posted by Erik - 29 Jul 2014