/* * Criação de uma nova thread, com envio de valor de retorno (endereço * utilizado como inteiro). */ #include #include #include void* f_thread(void *v) { printf("Nova Thread.\n"); return (void*) 256; } int main() { pthread_t thr; int retorno_thr; pthread_create(&thr, NULL, f_thread, NULL); pthread_join(thr, (void**) &retorno_thr); printf("Valor de retorno: %d \n", retorno_thr); return 0; }