while(1)
{
pthread_t id;
int ret;
pthread_mutex_lock(&mutex);
ret=pthread_create(&id,null,(void*)thread_block,paremeterfromyourfunction);
pthread_mutex_unlock(mutex);
}
首先多线程一般都是死循环
按照下面的例子写
while(1)
{
pthread_t id;
int ret;
pthread_mutex_lock(&mutex);
ret=pthread_create(&id,null,(void*)thread_block,paremeterfromyourfunction);
pthread_mutex_unlock(mutex);
}
首先多线程一般都是死循环
按照下面的例子写