多线程中打印问题?-灵析社区

万码UQ7VOTZJ

``` language #include #include #include void *testThread(void *arg){ printf("This is a thread test\n"); return NULL; } int main(){ pthread_t tid; int ret; ret = pthread_create(&tid,NULL,testThread,NULL); printf("This is a main thread\n"); pthread_join(tid, NULL); // 等待新线程完成 return 0; } ```

阅读量:1

点赞量:0

问AI