#include<iostream>
#include <vlc/vlc.h>
using namespace std;
#include<stdio.h>
#include <pthread.h>
void func(){
pid_t pid;
pthread_t tid;
pid = getpid();
tid = pthread_self();
while(i <5){
cout << "a";
i++;
}
}
int i=0;
bool flag =0;
void *thr_fn(void *arg){
return ((void *)0);
}
int main(){
pthread_t a;
pthread_t b;
//int err;
pthread_create(&a,NULL,thr_fn,NULL);
return 0;
}
两个线程交替打印ABABAB
最新推荐文章于 2024-03-07 08:57:08 发布