How to wait for a thread to end?

Dear riot developers,

while writing tests I want to wait for a thread I created to end. I tried something with changing my own priority but it did not work.

How can I wait for a thread to end?

Thank you in advance.

Cheers, Julian


not 100% sure if this can be done generally (apart from the state checks it should AFAICS), but have a look how the pthread implementation how it implements pthread_join() [1] which is essentially what you are trying to do (see pthread_join(3)).

Cheers, Martine