el comportamiento de este código?¿Es válido llamar a pthread_join en el hilo principal? Está bien definido
#include <stdio.h>
#include <pthread.h>
pthread_t mt;
void *start(void *x)
{
void *y;
pthread_join(mt, &y);
printf("joined main thread\n");
return 0;
}
int main()
{
pthread_t t;
mt = pthread_self();
pthread_create(&t, 0, start, 0);
pthread_exit(0);
}
¿Consideraría agregar un enlace a su fuente para la última edición? Creo que lo obtuviste aquí: http://pubs.opengroup.org/onlinepubs/009695399/functions/exec.html, pero antes quería confirmarlo. ¡Gran respuesta, sin embargo! – currysensei
@currysensei: ¡Agregado! – psmears