I've stumbled across a code example here. The lines that caught my attention (all other lines skipped):
{
...
void *res;
...
s = pthread_join(tinfo[tnum].thread_id, &res);
...
free(res); /* Free memory allocated by thread */
}
Can anyone deeper into pthreads than myself comment on the free(res)
, please? I have to say I have never seen this before, and that googling for 1-1.5 hours didn't give me any other similar examples.