C++-利用Pthread实现多线程

Pthread多线程举例。

#include <pthread.h>

void* newThreadFunction(void* arg){
    // Do things..
}


pthread_t newThread;
int ret = pthread_create(&newThread, NULL, newThreadFunction, NULL);
if(0 != ret)
    cout << "pthread_create error:error_code=" << ret << endl;
YI wechat
欢迎您扫一扫上面的微信公众号,订阅我的博客!