Each execution thread function needs to check the error function call error
1. How can the calling thread?
Thread function return type is void *
Pthread.h header files need support
Create a thread:
pthread_t xxx;
pthread_create ( & xxx, NULL, name of the function performed, NULL)
Recycling thread
void * xxxx; pthread_join (thread name, & xxxx)
To prevent the threads call the same variables, the need to establish a mutex
Create a mutex:
pthread_mutex_t xxx=PTHREAD_MUTEX_INITIALIZER
Use mutex
pthread_mutex_lock(&xxx);
pthread_mutex_unlock(&xxx);