pthread_create()函数有四个参数:
- pthread_t *thread:用来存储新创建线程的线程ID。
- const pthread_attr_t *attr:用来设置线程的属性,一般设为NULL。
- void *(*start_routine)(void *):新线程的入口函数。
- void *arg:传递给新线程的入口函数的参数。
pthread_create()函数会创建一个新的线程,并立即执行入口函数 start_routine,传入的参数为arg.
pthread_create()函数有四个参数:
pthread_create()函数会创建一个新的线程,并立即执行入口函数 start_routine,传入的参数为arg.