Başarılı durumda 0 döner. Hata durumunda ise geriye bir hata kodu dönecektir.
thread parametresi pthread_t türünde olup önceden tanımlanması gerekir. Oluşan thread'e bu referansla her zaman erişilebilecektir.
attr parametresi thread spesifik olarak pthread_attr_ ile başlayan fonksiyonlarla ayarlanmış, scheduling policy, stack büyüklüğü, detach policy gibi kuralları gösterir.
start_routine thread tarafından çalıştırılacak olan fonksiyonu gösterir.
arg ise thread tarafından çalıştırılacak fonksiyona geçirilecek void*'a cast edilmiş genel bir veri yapısını göstermektedir.
Örnek Uygulama
#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <pthread.h>void*worker(void*data){char*name =(char*)data;for(int i=0; i<120; i++){usleep(50000);printf("Hello from thread %s\n", name);}printf("Thread %s done...\n", name);returnNULL;}intmain(void){pthread_t th1, th2;pthread_create(&th1,NULL, worker,"A");pthread_create(&th2,NULL, worker,"B");sleep(5);printf("Exiting from main program\n");return0;}