“pthread_create” Kode Jawaban

pthread_create

pthread_t tid; //declaration of thread id
pthread_create(&tid, NULL, &routine, NULL); 
//routine is a function that takes in void pointer and returns a void pointer
pthread_join(tid)
Chetan Sharaf

pthread_create

       #include <pthread.h>

       int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
                          void *(*start_routine) (void *), void *arg);

       Compile and link with -pthread.
Outstanding Okapi

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya